Quantcast
Channel: Dave Copeland :ruby:
Viewing all articles
Browse latest Browse all 619

Article 0

$
0
0

TIL my new least favorite thing about JS:

“”.split(/,/) === [ “” ]

“foo”.split(/,/) === [ “foo” ]

wtf

reasonable behaviors instead would include:
• empty array
• null/undefined/false
• the original string

So, I guess I'm meant to do

let result = string.split(/,/)
if (result == [ originalString ]) {
result = []
}

??


Viewing all articles
Browse latest Browse all 619

Trending Articles


Girasoles para colorear


Tagalog Quotes About Crush – Tagalog Love Quotes


OFW quotes : Pinoy Tagalog Quotes


Long Distance Relationship Tagalog Love Quotes


5 Tagalog Relationship Rules


Re:Mutton Pies (lleechef)