Here is a list of javascript operator and how to use it!
You should mark this and use it when you need to know what is this operator!
In order to...
For further actions, you may consider blocking this person and/or reporting abuse
A couple of thoughts, one technical and one subjective:
the
...
on the left-hand-side of an assignment statement is also a "rest" operator. "spread" is for expressions (or rhs in statements). When you are putting a bunch of stuff into something, it's a "spread". When you are pulling a bundle of stuff out of something, and giving that bundle a new name, it's a "rest". In functions you are pulling the bundle out of the arguments arrayconst f = (x, y, z, ...extraDimensions /*rest of the args*/) => {};
const [x, y, z, ...extraDimensions /*rest of the array*/] = dimensions;
const { x, y, z, ...extraDimensions /*rest of the object*/} = dimensions;
I personally feel you should be using
??
at least as often as you are using?.
, if not more often. Again, this is the subjective opinion. If you are often using?.
that means you are often gettingundefined
. If you are passingundefined
around, it means that you are often forcing other people (or other parts of the codebase) to do null checking. If you are handling those missing holes in your data with??
, then you have fewer reasons to use?.
farther down the line... Null checking is Sir Tony Hoare's "Billion-Dollar Mistake" and is generally better handled on the outskirts of a system, near the I/O, rather than in the middle of all of the logic... the opinion might be subjective, but it's got a pretty sound backing, by even the inventor of Null (or the person who introduced the concept to programming languages), let alone language researchers.thanks for replied! I changed a few things for
...
operatorFun article, thanks for it! MDN has some great resources on this topic as well developer.mozilla.org/docs/Web/Jav... developer.mozilla.org/docs/Web/Jav... developer.mozilla.org/docs/Web/Jav...
Nice sharing! didn't read at all but it seems to be nice!
Thanks Yarip
Perfect work..
thank you a lot
Perfect work
thanks a lot!
Article of the month. Nice.
thank you a lot mate
Small correction in the code snippet for logical Nullish Coalescing.,
It was mentioned right-handed instead of left-handed.,
thanks it's fixed :D
Very nice feedbacks luke!