What is Short-Circuiting of Logical Operators?

The logical operators (&& and ||) will convert their left-hand value to a Boolean type. It then decides what to return. It can either return the original left-hand value or the right-hand value. The or operator (||) will return the left value if it’s converted to true and it will return the value on the … Read more

Does JavaScript Automatically Convert Types?

JavaScript is built to be innovative and smart. Some other languages aren’t built to auto-convert types to other types, so an expression can be easily evaluated. In JavaScript, it can automatically change numbers to strings and words to numbers as long as it’s in the appropriate setting. Take for example: JavaScript can automatically convert null … Read more

How to Compare With Greater Than, Less Than, Equal To, and Not Equal To Operators in JavaScript (Easy!)

I’ve stated this before, and I’ll say it again. Uppercase letters are less than lowercase letters. JavaScript reads from left to right. The size of the letters gets bigger from “a” to “z.” But here’s something interesting. It turns out that capitalization takes precedence over the actual order of the alphabet! So if you’re comparing … Read more

What is Infinity, -Infinity, and NaN Number Types in JavaScript? (EASY Explanation!)

There are 3 special types out there that are considered numbers but don’t actually behave as numbers. Infinity and -Infinity in JavaScript These are the positives and negatives of the concept of infinity. They can both be considered the same since a negative infinity translates into the concept of infinity as well. NaN in JavaScript … Read more