4 ms·
What does !-- do in JavaScript?
- zaroth 11y agoCalling a function exactly once after a group of operations have completed is a pretty common pattern in Node.
- antoaravinth 11y agoRight. Even in normal js world, I have seen people using + for converting their types to Number.
- datalist 11y agoIt is interesting that this question spawned such criticism/discussion as to whether it should be done in Javascript or not, but not as to why the OP did not know such basic language operators in the first place. Alright, he did not know them and hence asked (thats after all what a forum is there for) but then simply explain it and carry on. Discussing the "evilness" of basic negation and decrement operators is useless and counter-productive.