|
|
|
|
|
by scishop
3664 days ago
|
|
On the flip side of things, I might prefer to see a candidate come up with something like this as first stab rather than that 35-line mammoth of an isPalindrome() function in the article. function isPalindrome(str) {
return (str.split("").reverse()).join("") == str;
}
|
|
1. Knows about es6
2. Knows about === and !==
3. O(n) efficiency with no memory bloat
4. Didn't write 30+ lines on a trivial function
I won't even add a comment about unicode since it should be your default assumption when working with javascript that multi-byte characters and surrogate pairs don't work properly.