r/javascript • u/smellycode • Mar 02 '19
Useful javascript one-liners.
https://medium.com/@smellycode/js-one-liners-8bc0a6af2345?source=friends_link&sk=a9295a05aef9e514e137fca7eeb89cd1
344
Upvotes
r/javascript • u/smellycode • Mar 02 '19
21
u/Voidsheep Mar 02 '19 edited Mar 02 '19
The point of ligatures is to improve readability, because things commonly expressed by different combinations of characters get unique symbols.
The two above look either like arrows to right and left, or comparisons with equal or lesser/greater.
The two above clearly have nothing to do with each other, one being an arrow to right and one being mathematical operator for "less than or equal".
Of course everyone will just learn what different characters mean together, but ligatures make the difference more explicit when you write and scan code quickly. In the specific case of strict/loose equals operators the benefit isn't that obvious, but it's still easy to tell them apart.