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.
I'm in love with this kata's description.
I found it very creative and helpful, but with a thorough and kind description like this, it would be great to have more diverse tests cases to pass so it becomes a bit more complex and challenging.
Objects, as opposed to primitives, are passed by reference in JavaScript. That means you can modify them. You shouldn't. You should return a new object. (Generally.)
Thank you for your feedback, this is very obviously my first time:) Will add some random testing! What do you mean with modyfying the input argument?
No random tests.
Also, modifying the input argument as the example solution does is not a best practice.
Thank you! I realised this error soon after I posted, sorry for stupid question:)
Make sure you're
returning
the value instead ofprinting
it to the console using console.log. Returning the value actually modifies the variable and therefore allows it to be checked for equality. Undefined is the default value when nothing is returned.Hi, Im totally new to this, and I don't really understand what I'm doing wrong. I keep getting this message "Test Results:
Log
5050
✘ Expected: 5050, instead got: undefined"
I do get 5050, tried the code in another console too and it worked fine. So do anyone have any idea why it doesnt work here?