forked from OleksiyRudenko/a-tiny-JS-world
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
53 lines (48 loc) · 1.14 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
/* Refer to https://github.com/OleksiyRudenko/a-tiny-JS-world for the task details
Complete the below for code reviewers' convenience:
Code repository: https://github.com/Yuliiadd/a-tiny-JS-world
Web app: https://yuliiadd.github.io/a-tiny-JS-world/
*/
// ======== OBJECTS DEFINITIONS ========
const man = {
species: 'Human',
name: 'Joe',
gender: 'male',
legs: 2,
hands: 2,
saying: 'How you doing?'
};
const woman = {
species: 'Human',
name: 'Monica',
gender: 'female',
legs: 2,
hands: 2,
saying: 'I know!'
};
const cat = {
species: 'cat',
name: 'Taras',
gender: 'male',
legs: 4,
hands: 0,
saying: 'Meeeeoow!'
};
const dog = {
species: 'dog',
name: 'Chappy',
gender: 'male',
legs: 4,
hands: 0,
saying: 'Woooof!'
};
const catWoman = Object.assign({}, cat);
catWoman.species = 'Cat-woman';
catWoman.name = 'Halle Berry';
catWoman.gender = 'female';
catWoman.legs = 2;
catWoman.hands = 2;
const livingBeings = [man, woman, cat, dog, catWoman];
livingBeings.forEach(({species, name, gender, legs, hands, saying})=> {
print([species, name, gender, legs, hands, saying].join("; "));
});