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.
This answer doesn't have the array brackets but the other 2 answers on top have it. I believe the question said to have the brackets.
else isn't necessary
This comment is hidden because it contains spoiler information about the solution
Thanks for completing the Kata, a good and compact solution! I just used plain text spaces in the test expectation as Codewars displays in plain text.
I'm just saying for JS I used
\xa0\
for spaces as mentioned here https://stackoverflow.com/questions/33539797/how-to-create-string-with-multiple-spaces-in-javascript. When I entered my results it gave me errors. I spent alot of time trying to figure out why it didn't work. the "expectecation" and the "actual" results from the tests were the same. Then I decided to use" "
as in" ".repeat()
. It was frustrating trying to figure out why the answer was not accepted.best function ever
And who voted this
best practice
? ;-)Is this a joke?
Yes, only the name in
fruitsName
is fruit ;-)In js ,fruitsName is an array of fruits. and the fruits paramater is an array of fruits and non fruits right (mixed)?
The list is preloaded for you under fruitsName in JS and $fruits_name in Ruby.
I dont understand when you say " you may need a list fruitsName" . are we supposed to create a list of all the fruits in the world and test to see if "bomb" is not in there. to me fruits in the paramater is a list of fruits but "bomb" isn't a fruit so we have to test the fruits paramater to an actual list of fruits ? fruitsName is an array? and we have to compare it to the fruits array paramater? I'm doning js coding
This comment is hidden because it contains spoiler information about the solution
Read the comments and description next time you have a problem - a person with the same problem as you posted a comment literally two comments under yours and was answered.
when i run the test it says i passed however when i click submit this comes up
TypeError: Cannot read property '0' of null
at sumArray
can someone please help me?
Loading more items...