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.
He calls the replace(). Replace accepts something called a regex (which tells your replace method to expect a certain type of string pattern -- in this case the regex is a '.' which ensures your input is any character but a line terminator). The second parameter replace accepts is a callback function. The callback function contains a dictionary of matching DNA values. This function runs on each individual character from the original dna string and 'replaces' it with the matching DNA value from the dictionary.
This seems to be a question, not an issue.
Please before posting an issue look at the top of the page to see how many people passed the kata in your language (1975 for JS - I suppose Js is your language...). When the number is big enough chances are there is a problem in your code then post a question, not an issue, to see if somebody has time to look at your code.
The first test you failed is
gap(11,30000,100000)
in fixed tests; this test is common to all languages (passed by 8217 people -see top of the page) so I am afraid there are some flaws in your code.Cheers.
This comment is hidden because it contains spoiler information about the solution
Doing it like that, you only add those properties to that particular array, you have to work with the class instead.
This comment is hidden because it contains spoiler information about the solution
That last sentence LOL.
And how did you extend it? We can't guess it. Post your code and mark your post as having spoiler content.
TypeError: numbers.square is not a function
at /home/codewarrior/index.js:83:28
at /home/codewarrior/index.js:89:5
at Object.handleError
Using Javascript. I've extended the 'numbers' array with the desired methods (square, cube, sum, average, even, odd). They run fine in my local environment and produce the expected outputs. But when I run the sample tests/attempt through the codewars platform I recieve the above error message. I'm a novice developer and don't quite understand what's happening behind the scenes but figured I'd submit the issue here for the admin to take a look at.