Using uppercase is irrelevant if you use regex like the title tells you to. In fact, your solution does not actually address the issue you linked. It'd fail if you'd run it in specific locales such as Turkish.
Good job bro i did the exact same thing!
Would this break when minified because there is no semicolon? Is semicolon best practices?
i wrote the exact same code lol
What happened to the highlighting?
You can simply directly filter(x => x) // Will filter out spaces, null etc..
that was so clever. I dont know why such solutions dont come to my mind. I always end up writing complex and inefficient algorithms for simple things
What filter(x => x !== '') means ?
Love it! It has the simplicity of the filter and is easier to understand than using a filter(Boolean)!
filter
filter(Boolean)
No, splice is mutative. Never mutate when writing functional code, which is clearly what this problem is asking for.
Wouldn't splice mutate numbers?
'The number will be passed in as a string',the description says it clearly
In case someone tries to run digits.substr(0, 5) on nodejs it won't work directly, instead convert it to a string: digits.toString().substr(0, 5)
Why Intl.NumberFormat() is not accept?
This comment is hidden because it contains spoiler information about the solution
Loading collection data...
Using uppercase is irrelevant if you use regex like the title tells you to.
In fact, your solution does not actually address the issue you linked. It'd fail if you'd run it in specific locales such as Turkish.
Good job bro i did the exact same thing!
Would this break when minified because there is no semicolon? Is semicolon best practices?
i wrote the exact same code lol
What happened to the highlighting?
You can simply directly
filter(x => x) // Will filter out spaces, null etc..
that was so clever.
I dont know why such solutions dont come to my mind.
I always end up writing complex and inefficient algorithms for simple things
What filter(x => x !== '') means ?
Love it! It has the simplicity of the
filter
and is easier to understand than using afilter(Boolean)
!No, splice is mutative. Never mutate when writing functional code, which is clearly what this problem is asking for.
Wouldn't splice mutate numbers?
'The number will be passed in as a string',the description says it clearly
In case someone tries to run digits.substr(0, 5) on nodejs it won't work directly, instead convert it to a string: digits.toString().substr(0, 5)
Why Intl.NumberFormat() is not accept?
This comment is hidden because it contains spoiler information about the solution
Loading more items...