I have been a software professional since I was in high school in 1998. I'm enthusiastic about open source, and I really enjoy working in unusual software systems or within strange constraints.
So many of these are wrong. #5 will return true for Date and #13 actually takes more work to use as a one liner than it would just use String.includes().
Comment hidden by post author - thread only visible in this permalink
They're wrong because they're most likely straight out of ChatGPT (or similar), and the author has not checked them before posting. Try entering the following into ChatGPT:
Write an article titled "Mastering JavaScript: Top 50 One-Liners Every Developer Should Know"
You'll get many of the same examples, with the same mistakes.
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
So many of these are wrong. #5 will return true for
Dateand #13 actually takes more work to use as a one liner than it would just useString.includes().They're wrong because they're most likely straight out of ChatGPT (or similar), and the author has not checked them before posting. Try entering the following into ChatGPT:
You'll get many of the same examples, with the same mistakes.