Types

Lecture Overview

What are types?

What Effect Do Types Have?

How to Identify Type?

typeof Example

let age = 28;
console.log(typeof age)

The sample script above produces the output below

number

JavaScript Booleans

Number Types

Number Example

let age = 28;
let averageHeight = 67.5
let typeOfAge = typeof(age)
let typeOfAverageHeight = typeof(averageHeight)
console.log(typeOfAge)
console.log(typeOfAverageHeight)

The sample script above produces the output below

number
number

Textual Type

String Example

let age = "28";
let averageHeight = "67.5"
let typeOfAge = typeof(age)
let typeOfAverageHeight = typeof(averageHeight)
console.log(typeOfAge)
console.log(typeOfAverageHeight)

The sample script above produces the output below

string
string