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.
Completely flew over my head to use ternary operators here!
Conditional operator
What does the ? and : mean in Javascript?
The second part (true or false) is unnecesary. It's already assesed in the parentheses
-1, needs more
?:
.I see this sort of thing a lot in code, and it's redundant. You should just return the original conditional check. Consider it as if it were the folowing:
The above would be better written:
Same idea with what is written in this solution.
This comment is hidden because it contains spoiler information about the solution
Thx, for the hint...
The expected result is correct. To see the problem of yor code try
console.log(30000000300000000+7)
. This produces 3000000030000010 instead of 300000030000007.There is a way to resolve the problem without using an accumulator with such enormous numbers.
This comment is hidden because it contains spoiler information about the solution