-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpgTwo.js
More file actions
32 lines (31 loc) · 1.05 KB
/
pgTwo.js
File metadata and controls
32 lines (31 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// String, Numbers, Boolean, null, undefined
const titleTwo = "///////////// THIS IS PAGE TWO /////////////";
console.log(titleTwo);
// the name Will is an example of a string
const name = "Carl";
// the age 30 is an example of a number
const age = 31;
// isCool = true is a true boolean, false is used as well
const isCool = true;
//decimal is just a number in JavaScript
const rating = 7.5;
// null is a variable with nothin in it. It's vacant
const x = null;
// undefined
const y = undefined;
let z;
// invoking all variables in the console in your browser. typeof tells you what type of variable youre using.
console.log(typeof name);
console.log(typeof age);
console.log(typeof isCool);
console.log(typeof rating);
console.log(typeof x);
console.log(typeof y);
console.log(typeof z);
// Concatenation /////
// OLD SCHOOL
console.log("my name is " + name + " and I am " + age);
// ES6 2015 Template String // second line below as a variable
// console.log(`My name is ${name} and I am ${age}`);
const hello = `My name is ${name} and I am ${age}`;
console.log(hello);