This is a draft cheat sheet. It is a work in progress and is not finished yet.
10) Declare a Read-Only Variable with the const
const FAV_PET = "Cats";
|
it cannot be reassigned. |
11) Add Two Numbers with JavaScript
12) Subtract One Number from Another
13) Multiply Two Numbers with JavaScript
14) Divide One Number by Another with JavaScript
15) Increment a Number with JavaScript
16) Decrement a Number with JavaScript
16) Create Decimal Numbers with JavaScript
|
|
1) Comment Your JavaScript Code
// This is an in-line comment.
|
/* This is a multi-line comment */
|
2) Declare JavaScript Variables
var myVar; let myLet; const myConst;
|
3) Understanding Uninitialized Variables
When JavaScript variables are declared, they have an initial value of undefined. If you do a mathematical operation on an undefined variable your result will be NaN which means "Not a Number". If you concatenate a string with an undefined variable, you will get a string of undefined. |
9) Explore Differences Between the var and let
unlike var, when you use let, a variable with the same name can only be declared once. |
|
|
3) Storing Values with the Assignment Operator
|