Using a time scale instead of normal numbers

Wow, you replaced all that green commented code with just a few lines and made it work.

This is something that puzzles me, there are difficult problems which can be solved easy and vice versa.

I see you used the word “Array” instead of creating it with [ ], also you used the […xxx] notation which I discovered this month but haven’t fully understood it.
Same with the map function, looks like those words do the same as my for and push loop but simpler.

So an important note there is that what you had would work. I’m just using shorter methods and tricks that you learn as you use Javascript more and more. There’s not a “right” way to do it, I just prefer it shorter and more readable.

It’s like learning maths in school; you learn the complex way, and then the teacher says “now that you know how and why it works, here’s how you can do it quicker.”

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.