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.
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.Is this a joke?
In js ,fruitsName is an array of fruits. and the fruits paramater is an array of fruits and non fruits right (mixed)?
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
This comment is hidden because it contains spoiler information about the solution
Thanks for your quick replies. That worked.
js
I got this as an error message
"Expected: Kj
Kj
SH
SH, instead got: Kj
Kj
SH
SH"
I thought I did it right? what do you think The error means?
I got:
Test Passed: Value == all this, used to be trees
Test Passed: Value == i, don't believe this round earth, show me evadence!!
Expected: kids me, money the old me these, the politics kids, the my, instead got: kids me, money the old me these, the politics kids, the my,
the
expected
and thegot
look the same to me and I dont know why theExpected
has a comma at the end. I thought we were not supposed to have commas at the endhow do you print the input for the failed test? I have 2 test failed and 113 passed. I dont know why it failed
shouldn't this work. It didn't pass this kata test but it passed my tests:
function add(){
var args = [].slice.call(arguments)
return Math.floor(args.reduce(function(prev, cur, i){
return prev/i + cur/i
}))
}