by Mike Coleman | Mar 27, 2020 | Javascript, Javascript Types
Booleans are true and false let Bob = 20; Bob === 19 //outputs FalseBob === 20 // outputs True NEVER USE == ALWAYS USE === Why? Triple === will check the value on the left and right are the same value and the same type “10” == 10 // this will give me...
by Mike Coleman | Mar 27, 2020 | Javascript, Javascript Types
let dog; console.log(dog); This produces undefined. Undefined comes when you try and access a variable that’s been created but not set. Null is a value of nothing. Undefined is a value of a variable that has not yet been assigned a value. Examples: let...
by Mike Coleman | Mar 27, 2020 | Javascript, Javascript Types
Objects are used for collections of data and collections of functionality. Let’s create an object called person. When you create an object you use curly brackets and you then define properties and values. const person = { first: ‘Mike’, last:...
by Mike Coleman | Mar 27, 2020 | Javascript, Javascript Types
Javascript numbers include integers and floats. You can concatenate numbers, even if they are enclosed in quotes, but using addition does not add the numbers. Example: a = 5 b = “7” / b is a string You can find the type of a variable by using this...
by Mike Coleman | Mar 27, 2020 | Javascript, Javascript Types
Javascript strings are very similar to python, with some differences. You can use single or double quotes, and you also can use backticks. Backticks are a great way to enclose strings that have both single and double quotes in them, as anything in a backtick is...