Skip to content

Commit

Permalink
Js world (#41)
Browse files Browse the repository at this point in the history
* create js-world

* create js-world

* fix catWoman

* aded catwoman saying
  • Loading branch information
Pozzitive11 authored Aug 2, 2022
1 parent e5d2816 commit ef712e6
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions submissions/pozzitive11/js-world/index.js
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);

0 comments on commit ef712e6

Please sign in to comment.