Code

General Code

Function Scope

In JavaScript, scope works a tad differently than normal OO languages. One of the scopes in JavaScript is function scope. What this means is that anything we define within a function is only available to that function and anything nested within that function. Here is an example… This console log statement will return an error […]

Function Scope Read More »

Assignment Operators

In JavaScript, there are some additional assignment operators that we can use in addition to the normal equal sign. There are several, but the most common are addition/subtraction assignment operators. Here is an example… The output of startYear would be 2021. We could do the same thing with -=. Happy Coding! Clay Hess

Assignment Operators Read More »

Conditional Operator

JavaScript has a conditional operator that we can use in place of an if statement. Here is the syntax… So we have a test , which is in the parentheses, then a question mark (?). If the test returns true, the expression prior to the colon returns. Otherwise, the content after the colon runs. These

Conditional Operator Read More »