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 wonder why this very simple solution doesn't get nearly as much "best practice" than the other one above there >^.^<
This comment is hidden because it contains spoiler information about the solution
What else you want me to do?
Damn, balu9 has no chill (⊙_⊙;)
This comment is hidden because it contains spoiler information about the solution
Nice
Nice!
What unexpected behaviour are you talking about here? The ECMA specification says that the radix will default to 10 unless the string starts with "0x", which can't happen here as all non-numeric characters are removed.
https://262.ecma-international.org/12.0/#sec-parseint-string-radix
I am, I look for it!
Of course, as long as you are ok with your code having unexpected behavior :D
I should do what I fancy to.
You should always provide radix (10 in this case) as the second argument to parseInt.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt
As far as I know, not using var will put any declaration in the global scope. So while you wouldn't want to do that on a real production app. Using it for these little solutions isn't necessarily wrong. As you probably don't need to worry about your namespace
here's an example:
drink = 'beer'
function drunk () {
console.log(drink)
}
drunk()
//'beer'
function wino () {
var drink = 'wine';
console.log(drink)
}
wino()
// 'wine'
drink
// 'beer'
why
var
is not used in this solution?This comment is hidden because it contains spoiler information about the solution
Loading more items...