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.
So you used apply() to be able to pass the array in the Math function as an argument, while the rest of them used the spread operator. New thing to me and useful too.
unnecessary loop and your conditions will be checked each loop (unefficient solution)
great answer, very selfexplanatory and few lines of code
Foi esperto
Nice work! This code is very readable and clear.
Nice work! This code is very readable and clear good.
Hmm, if use U solution we have results:
boolToWord('stroke')//'Yes'
boolToWord(55)//'Yes'
boolToWord([])//'Yes'
boolToWord('')//'No'
that's a good practice
This is a clever way to do it, its definitely more efficient than what I did. Using the for loop like this is a great way to do it.
U can use this method as well -
const arrayOfDigits = Array.from(String(num), Number);
here, Array.from() creates a new array from the array-like object, by passing String(num), we convert the number into a string, which splits it into its individual characters
the second parameter, Number, is a callback that converts each character back into a digit, creating an array of digits from the number
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This is good self documenting code, but I'd say the last line is completely unnecessary. Noting the sum and average is good practice enough.
i think so yes
This is great!
Loading more items...