Member-only story
Some lesser-known facts on Operators for JavaScript learners.
When I started learning JavaScript for the first time, I tried a crash-course style approach. I was already introduced to programming in other languages (like C, Python, etc.). Naturally, I thought I just needed to browse through the syntaxes and then get into coding. I printed out a concise cheat sheet to save paper and started grasping the contents by heart. It saved time, and I could quickly start coding with JavaScript. And for the little things that I was doing (like customizing an existing code for using it on my web page, adding buttons and handling simple events, or manipulating a little bit of DOM to customize it for a web page), I did not face many challenges. Things changed when I got into React. It needed a more thorough understanding of the language and its concepts. That is when I started making my own notes, ensuring I captured the nuances often missed in those starter cheat sheets. Here I share those lesser-known or often-overlooked concepts related to operators in JavaScript. Hope it helps those who might have missed these like I did initially.
Unary | Binary | Ternary Operators
The lessons on operators did cover a ‘special’ ternary operator, which is of the syntax: condition ? expressionIfTrue : expressionIfFalse. But I never really…