published: 4th of November 2021
Javascript is a dynamically type language. The types of variables are evaluated at runtime based on the contents of the variable.
Typescript is a superset of Javascript which adds static typing to the language (amongst other things).
There are two kinds of types in Javascript; Primative and Reference.
Strings can be defined with either 'single' or "double" quotes.
// Define a String
const name = "Jim Bob";
There is a single number type in Javascript to represent all numbers (int, float, etc..)
// Define a Number
const age = 42;
Booleans are true or false values.
// Define a Boolean
const smoker = false;
A null value represents the intentional absence of any object value. null is a falsey value.
// Define a Null
const shoes = null;
A variable is undefined when it is declared with no defined value.
// Define a variable with an undefined value
let pants;
Symbols were added to Javascript in ES6. Symbols represent values that are guaranteed to be unique.
// Define a symbol
const shirt = Symbol();
An array is an indexed list of values.
// Define an Array
const stuffAndThings = ["stuff", "things"];
An object is a hash of key/value pairs.
// Define an Object
const stuffAndThings = {
stuff: "stuff",
things: "things"
};
https://www.udemy.com/course/modern-javascript-from-the-beginning/
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol