Some of the points have already been made, but I'd like to add to the growing number who suggest that many of the 'improvements' are unreadable -> unmaintainable.
Many of us write in multiple languages. I prefer to write code in a style that is recognisable by the majority, not the nuanced minority. In other words, I'd use != every time. And toString(), too.
That said, there are one or two nice examples, so thanks for sharing. For example, this one's good, and much more readable: let outputArray = Array.from(new Set(array));
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.
Some of the points have already been made, but I'd like to add to the growing number who suggest that many of the 'improvements' are unreadable -> unmaintainable.
Many of us write in multiple languages. I prefer to write code in a style that is recognisable by the majority, not the nuanced minority. In other words, I'd use
!=
every time. AndtoString()
, too.That said, there are one or two nice examples, so thanks for sharing. For example, this one's good, and much more readable:
let outputArray = Array.from(new Set(array));