Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
goood job
looooook
Math.floor()
is used because the brief requests the answer rounded down to the nearest integer.Great work man!
Hello there! great work!
Yeah haha.
The variable names are extremely common, though I'd imagine some would choose
n
as opposed tox
for another common variation. Not all the code submitted is the same though -- you can use Show Variations feature to see the minor differences among submissions.kinda scary, even the variable names are the same 😅
Hi Mate
Hello
It's not about the language. Anonymous functions in JavaScript implicitly return whatever you put in them, and "the sum of 2 numbers" is equivalent to "the variable storing the result of summing 2 numbers". The same behavior is present in some other languages too (Python, Ruby etc.).
This comment is hidden because it contains spoiler information about the solution
works either way, welcome to js
Disclaimer: I am still noob with Javascript. Shouldn't be sum += x instead of sum + x?