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

What’s the Order of Precedence of The Logical Operators And, Or, and Not?

When it comes to a bunch of values in a row separated by a bunch of logical and comparison operators, you have to decide which values to evaluate or solve for first. It’s not always left to right. Some operators take precedence over the others. That sort of means you have to know what operator … Read more

How Does the Conditional Operator Work in JavaScript?

A few things about the conditional operator: It is a ternary operator (not unary or binary) meaning it works with three values It’s written using a question mark (?) and then a colon (:) The value to the left of the question mark returns a boolean concept of true or false. How does the conditional … Read more

How Logical Operators like And, Or, and Not Work in JavaScript (With Examples!)

In JavaScript, you only have to know about 3 logical operators, and the key terms used here are pretty English. You just have to remember that there’s an and, or, and a not which are all related to Boolean values. Also, the “and” and “or” operator is binary operators, so you need to have 2 … 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

How to Compare Strings Using the Greater Than and Less Than Comparison Operators in JavaScript (Easy!)

Okay, so far we’ve only compared numbers, but what about the letters of the alphabet? Comparing strings in a word is very similar to how you would compare letters in the alphabet, but with a few differences. How are letters of the alphabet prioritized in JavaScript when compared? Uppercase letters are always less than lowercase … Read more

How to Use the Greater Than and Less Than Comparison Operators in JavaScript (With Examples!)

Boolean type values only have two results: true or false. The words true and false are actual keyword values here. Comparing Boolean values with the “less than” or “greater than” operator The > operator means “greater than” and the < operator means “less than.” These are binary operators and thus require two values. One on … Read more

What Are Binary and Unary Operators in JavaScript? (Simple Examples!)

A binary operator is an operator that uses two values, while a unary operator only uses one. Take, for example, the typeof operator. You give it a value and it’ll tell you what type that value is. Is the typeof operator binary or unary? Guess what the typeof operator it is, unary or binary? It’s … Read more

How to Escape Backtick-Quoted Strings in JavaScript (Example!)

So we all know that there are 3 ways to present a string. Single-quotes Double-quotes Backticks The truth is that single and double-quotes are identical. You can use them interchangeably. However, backticks allow you the added option to escape the string. Backticks-quoted strings are also known as template literals. Unfortunately, in order to make JavaScript … Read more