-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.js
45 lines (36 loc) · 910 Bytes
/
variables.js
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
33
34
35
36
37
38
39
40
41
42
43
//let is used for values that will change
//const is used for values that will stay constant
//format: keyword name = value;
const userID = 123456789;
let userName = "Squidney";
let progress = 0.75;
let xp = 60;
let verified = true;
//naming convention is camelCase
console.log(userName)
userName = "Sydney Vo"
console.log(userName)
/* 8 data types:
Number (integers/decimals)
strings (text)
boolean (true/false)
null (intentional absence of value)
undefined (variable declared but unassigned)
*/
let friedRice = 10
let typeOfRice = "fried rice"
let leftOvers = true
console.log("")
console.log(friedRice)
console.log(typeOfRice)
console.log(leftOvers)
//arithmetic operators:
// +, - , *, /, %, **
//PEMDAS
console.log("")
let tempBrooklynF = 74
let tempBrooklynC = (tempBrooklynF - 32) / 1.8
console.log(tempBrooklynC)
console.log("")
let bmi = 54 / (1.55 ** 2)
console.log(bmi)