JS is dynamically typed. You don't have to declare a type. types are determined automatically.
Values stored in variables have types, not the variables themselves.
console.log(typeof "word") logs the type (in this case string)
typeof null returns object. This is a legacy error.
creating a string without using quotes will give you an error.
let string = this creates an error logs "Uncaught SyntaxError: Unexpected identifier"
... coming soon
- numbers - floating point. Decimals and integers
- strings - characters
- boolean - true or false
- undefined - empty values
let name;declaring a variable without assigning a value will have undefined as it's value
null - the intentional absence of any object value.
- symbol(ES2015) - guaranteed to be unique. Often used to add unique property keys to an object
- BigInt(ES2020) - for larger integers than number can handle