Code

General Code

Unary Operators

Unary operators are ++ and –. Each of these either increment by one or decrement by one. It is important to understand how these interact with variables because they can be placed prior to or after a variable. For example… This would log out 2021. Let’s change it a bit… The value 2020 would be […]

Unary Operators Read More »

Equality Operators

In JavaScript there are two ways to test equality/inequality. We can use two equal signs (==) or three equal signs (===). For inequality, it is similar != and !==. So what’s the difference? The difference is type. For example… This would return true because with a double equal sign, JavaScript converts types. The string of

Equality Operators Read More »

Type Conversion

In JavaScript, we sometimes need to convert from one type to another. We can use a toDtring method to convert to a string. To convert to numbers, we can use parseInt and parseFloat. The biggest difference between the two is that parseFloat deals with decimal points. Each one of the methods returns the numbers of

Type Conversion Read More »