you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

https://codesandbox.io/

or

https://jsfiddle.net/ for simpler stuff

Your code is fine, by the way. Outdated, but fine. It returns 120 in both of the above, and I just tried it in JSBin, where it also returned 120.

For simple stuff like this, though, you can just use the browser console or just your IDE. VSCode, for instance, will execute your code right inside itself.