Java Notes
Java Notes
console.log
console.log(typeof nameOfTheVariable);
Comment out
Multi line
comments:
*/
javascriptIsFun = 'YES!';
Template Strings
console.log(`String
multiple
lines`);
} else {
TYPE CONVERSION
TYPE COERCION
A value is a piece of data.
It's the most fundamental unit of information that we have in programming. Smallest unit of
information that we have in JS.
Whenever you have multiple words in a variable name, write the first word with a lowercase and then
all the next words with upper case.
firstName
firstNamePerson
PI = 3.1416
- Variable names can only contain numbers (not at the beginning), letters, underscores, or the
dollar sign.
let -> declare variables that can change later (during the execution of our program)
const -> not supposed to change at any point in the future. It cannot be changed.
x = y = 25 - 10 - 5;
console.log(x, y);
We get: 10 10
TYPE COERCION is when JS automatically converts types behind the scenes from us.
ASSIGNMENT OPERATORS
let x = 10 + 5; (15)
x += 10; (x = x + 10 = 25)
x *= 4; (x = x * 4 = 100)
x ++; (x = x + 1)
x --; (x = x - 1)
COMPARISON OPERATORS
TEMPLATE STRINGS
ONE LINE:
MULTIPLE LINES:
1. console.log(`String
2. multiple
3. lines`);