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.
Yes, they're used for string concatenation. It's the construction of a regular expression by string.
This comment is hidden because it contains spoiler information about the solution
Cause you do not return anything :3
function(x){
return x2
}
like this:
x=>x2
(points[1] - points[3]) / (points[0] - points[2])
:convert this part of your answer to a string.A function is not used only once. It can be used again and again.
Just think bout what happens when you call the getNiceNames function twice.
The first time, it returns the correct array, but the second time, it starts pushing to the same array left after the first call.
You need a new array every time the function is called. Which is why both the arrays have to be initialized in the function body itself.
This solution just creates a variable
SafeInteger
equal to the inbuilt function Number.isSafeInteger which has the same utility as that required by the kata.The function
Number.isSafeInteger()
itself is assigned to thevar SafeInteger
and so SafeInteger inherits the properties of isSafeInteger. Basically, SafeInteger is an alias to Number.isSafeInteger.