Skip to content
This repository was archived by the owner on Aug 5, 2021. It is now read-only.

Js core3/week3/denis p #54

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
2nd exercise DONE
  • Loading branch information
Denis-Andrei committed Sep 18, 2020
commit 3e12e08fcf915f2cf4c3df7459797c6ce1dfff4b
11 changes: 11 additions & 0 deletions week-3/Homework/mandatory/2-exercises/exercise-2/exercise-2.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,14 @@ let hogwarts = [
{ firstName: "Minerva", lastName: "McGonagall", house: "Gryffindor", pet: null, occupation: "Teacher" },
{ firstName: "Albus", lastName: "Dumbledore", house: "Gryffindor", pet: "Phoenix", occupation: "Teacher" }
]




hogwarts.forEach(({firstName, lastName, house}) => {
house === 'Gryffindor' ? console.log(`${firstName} ${lastName}`) : '';
})

hogwarts.forEach(({firstName, lastName, pet, occupation}) => {
pet && occupation === 'Teacher' ? console.log(`${firstName} ${lastName}`) : '';
})