-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
54 lines (43 loc) · 1.17 KB
/
index.js
File metadata and controls
54 lines (43 loc) · 1.17 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
'use strict';
// const sentence = 'this is a string';
// let happy = true;
// console.log(typeof sentence, sentence);
// console.log(typeof happy, happy);
// console.log(typeof age, age);
// console.log(typeof hairColor, hairColor);
// const name = 'josh';
// let happy = true;
// let age = 33;
// const hairColor = 'red';
// const josh = [name, happy, age, hairColor, ['kids', 'dogs', 4]];
// for (let index = 0; index < josh.length; index++){
// console.log(josh[index]);
// }
// const Josh ={
// name: 'Josh',
// age: 33,
// happy: false,
// hairColor: 'red'
// };
// const Alex ={
// name: 'Alex',
// age: 25,
// happy: true,
// hairColor: 'black'
// };
// const Kevin ={
// name: 'Kevin',
// age: 31,
// happy: true,
// hairColor: 'brown',
// };
// const studentArray =[Josh, Alex, Kevin];
// console.log(studentArray);
// for (let i = 0; i < studentArray.length; i++){
// console.log(`Hello, ${studentArray[i].name}. I heard you are ${studentArray[i].age}. That sure is old! Why are you so ${studentArray[i].happy ? 'happy' :'unhappy'}?`);
// }
// if(Josh.happy) {
// return 'happy';
// } else {
// return 'unhappy';
// }