And how is it possible that now my function does not pass the test nor the attempts with this exact code writting? It says 'undefined expected to be 'Hello boss''.
This approach relies on the assumption that the array contains only boolean values (true or false). If the array contains other values that might affect the sum, such as null, 0, or strings, then this approach might not give the correct result.
For JavaScript of course not
This comment is hidden because it contains spoiler information about the solution
no need for zero(initialValue)
And how is it possible that now my function does not pass the test nor the attempts with this exact code writting? It says 'undefined expected to be 'Hello boss''.
This approach relies on the assumption that the array contains only boolean values (true or false). If the array contains other values that might affect the sum, such as null, 0, or strings, then this approach might not give the correct result.
Best solution!
Numbers of best practices and clever are low. The comunity of Php is small ?
This comment is hidden because it contains spoiler information about the solution
Took a while to make it in Java, but made it in JS in 1 min...
F# me!
nice solution
No, since the function ends as soon as it meets a
return
statement.the "else" is not necessary?
Wow! never thought of using regex :<
nice
viewing solutions is depressing....
Loading more items...