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.
debatable as to whether this is good practice or not, but history proved you wrong by adding full-fledged classes to JavaScript, with private and static properties
You should refer to sample tests and throw the corresponding message instead of an empty string
There can be valid reasons to mutate inputs ( eg. performance. did you ever stop and wonder why eg. default JS sorting behaviour is modification in place? ). So if a kata specifically specifies ( and tests! ) this behaviour, you can have your doubts, but it makes a valid kata.
I fully agree side-effect-free programming has its advantages ( as well as its disadvantages, but you're not even mentioning those ). But single-mindedly forbidding valid language features in kata, or even kata about valid language features, is just closed-minded. Everything's a trade-off, including side-effect-free programming.
Yeah, that confused me for a while. I just directly followed the examples
just print the given array and average and your answer in your solution, you will get to know all the test case
This issue is completely valid - a static method, equivalent to (for example)
Arrays.sort
in Java ,would simply beArray.remove_
in JavaScript. Attaching to the prototype means the method is available on each instance and each instance only. It would be the equivalent of sorting arrays in Java in the following mannerThis is a suggestion.
"The problem is, you ether learned this lesson already, then this is trivial, or you do not know where the problem is. "
A lot of bug fixing is like that, obvious when you have seen it before, mindnumbingly frustating otherwise.
Thanks
A bigger irony is use a design pattern i.e. prototype to justify avoiding learning OOP. I can put the output of this problem in babeljs in ES5 but I'm pretty sure that you will say something like adding OOP approach in ES5 is too complex for most users and too boilerplaty
Glad you could solve it.
Read the posts below yours, it'll give you an idea about what's going on.
Uhm... no?
If you're asking this question then that means you haven't got the idea of the kata yet. So it's not an issue.
The irony in ES6 being called "classical".
Changed.
Loading more items...