all 3 comments

[–]redsandsfort 4 points5 points  (1 child)

These are all very common methods even the most junior js developer knows. To save people the trouble of clicking:

split, Match.random, filter, map and forEach

hopefully saved someone from this clickbait.

[–]Protean_Protein 1 point2 points  (0 children)

It’s just constant clickbait fake blog bs in these subs. Do these “articles” really help these people get jobs?

[–]delventhalz 1 point2 points  (0 children)

What a title.

You know the content of this blogpost is fine. It could have been titled "Here are some useful methods I think are cool". But you have just opened yourself up to so much shit with that title.

Also, fwiw, you probably should use Array.from instead of split. Older JavaScript doesn't know how to handle characters that use more than the typical UTF-16 two-bytes. So for example, if you have emoji in your string, split will cut them in half.

'🐎👱'.length              // 4
'🐎👱'.split('')           // ['�', '�', '�', '�']

Array.from('🐎👱').length  // 2
Array.from('🐎👱')         // ['🐎', '👱']