-
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* create js-world * create js-world * fix catWoman * aded catwoman saying
- Loading branch information
1 parent
e5d2816
commit ef712e6
Showing
1 changed file
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
const dog = { | ||
species: "dog", | ||
name: "Dick", | ||
gender: "male", | ||
legs: 4, | ||
hands: 0, | ||
saying: "woof-woof!", | ||
}; | ||
|
||
const cat = { | ||
species: "cat", | ||
name: "Kitty", | ||
gender: "female", | ||
legs: 4, | ||
hands: 0, | ||
saying: "mur", | ||
}; | ||
|
||
const woman = { | ||
species: "woman", | ||
name: "Dazdraperma", | ||
gender: "female", | ||
legs: 3, | ||
hands: 1, | ||
saying: "It used to be better", | ||
}; | ||
|
||
const man = { | ||
species: "man", | ||
name: "Mike", | ||
gender: "male", | ||
legs: 2, | ||
hands: 2, | ||
saying: "Hello World!", | ||
}; | ||
|
||
const catWoman = { | ||
species: "catwoman", | ||
name: "Nazar", | ||
gender: "femalmale", | ||
legs: 2, | ||
hands: 2, | ||
}; | ||
|
||
Object.setPrototypeOf(catWoman, cat); | ||
|
||
const inhabitants = [dog, cat, woman, man, catWoman]; | ||
const inhabitantsValues = [ | ||
"species", | ||
"name", | ||
"gender", | ||
"legs", | ||
"hands", | ||
"saying", | ||
]; | ||
|
||
const connectInhabitantsAndValues = inhabitants.map((item) => | ||
inhabitantsValues.map((value) => item[value]) | ||
); | ||
|
||
const showInhabitantsInHtml = connectInhabitantsAndValues.join(";\n \n") + ";"; | ||
|
||
print(showInhabitantsInHtml); |