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.
Great! I've learned something new. How does this compare to using parseInt? What I've typically done
http://stackoverflow.com/questions/600293/how-to-check-if-a-number-is-a-power-of-2
Anyone wanna explain this one ?
@ca6age:
var handled = ending.replace(/[.+]/g, '\$&');
return new RegExp(handled + "$", "i").test(str);
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Regex was my initial thought but I didn't know how it will handle string with regex symbols like '.', '+', etc.
Any clues about that?
It has to do with the way that functions are called. If you substitue the addOne(3) with the value assigned to it, you get:
var addOne = add(1); addOne(3) equals add(1)(3);
So the call passes the arguments in the set order.
Could anyone explain to this newb, how does this work ?