The variable names are extremely common, though I'd imagine some would choose n as opposed to x 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.
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.).
goood job
It's not the best practice and performance.
What's happening here will understand only omnipotent
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
Loading more items...