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.
'looks like you've solved it'
You're not changing
p
norp0
values, so, you have an infinite loop there.if (13 > n > 0)
works in a different way from what you expect. It's the same as(13 > n) > 0
orif (13 > n) {return true > 0} else {return false > 0}
.Your algorithm is wrong then. Even from the screenshot I can see that you do throw an error, but not in all cases when it's needed.
Try simply
throw RangeError
.=
assigns,==
or===
compares.This is not how you do comparison, and it will always return
true
.See how the method is called on the sample test, it doesn't use a parameter.
=+
doesn't exist as an operator and that's no way to add an element to an array, use.push
Try doing some research, MDN is a good source.
If the question was "why is it mandatory?" the answer is simply that the testing code must know the function's name to test it ^^'
If it was "why replace specifically?" then myjinxin answered you, because the function does replace vowel by '!'.
There is no particular reason, just because the name of kata is "replace xxxxxx...."
I'll give you a spoiler-free example:
You should use sum(1, 2) there to get 3.
You use an if in your function, it's always passing by the else so all tests that expect
odd
will get the right answer (not for the right reason tho)arraySum
is a function there, you should call it and pass it an input value.You have to edit that line to create your own test (or tests).