-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
79 lines (57 loc) · 1.46 KB
/
index.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// //data types
// //strings, integers, float, boolean, null, undefined, symbol, BigInt
// //Primitive datatypes:
// //Non primitive data types
// // - objects
// // - arrays
// // - functions
// var name1 = "Dj";
// let name2 = "Junior";
// const name3 = "Yolanda";
// console.log(name1)
// console.log(name2)
// console.log(name3)
// const fruits = ["mango", "banana", "orange", "grapes", "apples"]
// const everythingFromOrange = fruits.splice(2, 3)
// // const numberOfFruits = fruits.length
// // const mango = fruits[0]
// // const orange = fruits[2]
// // const removeApple = fruits.pop()
// // const removeMango = fruits.shift()
// // const addLemon = fruits.push("lemon")
// // const addKiwi = fruits.unshift("Kiwi")
// // console.log(removeMango)
// console.log(everythingFromOrange)
// // console.log(addKiwi)
// // console.log(removeApple)
// // console.log(mango)
// const add = "1"+1
// console.log(fruits)
// console.log("1"===1)
//teenager, adult
let age = 25;
let ageGroup;
if (age < 16){
ageGroup = "Minor"
console.log("You are ", ageGroup)
if (age == 30){
console.log("Show age group content")
}
else if (age == 25){
console.log("Show 25 year old content")
}
}
else if (age > 16 && age < 20){
ageGroup = "Teenager"
}
else {
ageGroup = "Adult"
}
//object has properties
let John = {
middle: "sfiso",
top: "nike"
}
//updating the object
John.top = "Kappa"
console.log("You are ", ageGroup)