Code

General Code

Variable Types

Since a variable can hold numerous data types, it is important to ensure that the value of a variable is the expected data type. In JavaScript, this can be done with the typeof operator or method. They both pretty much do the same thing but have syntax differences. Typeof operator The console log should output […]

Variable Types Read More »

Common Code Errors

Syntax Error Another error is a syntax error. This is when your code violates the standards of the language. For example, if we utilize a restricted keyword incorrectly… If we console log the variable “class” out, we will see the error…SyntaxError: Unexpected token class. This is because “class” is a restricted keyword in JavaScript. Here

Common Code Errors Read More »

Common Code Errors

Anytime you are coding, errors are going to occur. As you gain experience, you will get better at either not making errors, or recognizing errors and why they occur. Let’s take a look at some common errors to understand them and why they occur. Reference Error This error occurs when a reference is made to

Common Code Errors Read More »