Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.
Open
Show file tree
Hide file tree
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
Next Next commit
Moved all mandatory changes
  • Loading branch information
edksam committed Jul 20, 2020
commit b2b84f62ea48683a7853ec6fbb334474dee36353
21 changes: 16 additions & 5 deletions Week-1/Homework/mandatory/1-writers.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,42 @@ let writers = [
lastName: "Woolf",
occupation: "writer",
age: 59,
alive: false
alive: false,
},
{
firstName: "Zadie",
lastName: "Smith",
occupation: "writer",
age: 41,
alive: true
alive: true,
},
{
firstName: "Jane",
lastName: "Austen",
occupation: "writer",
age: 41,
alive: false
alive: false,
},
{
firstName: "bell",
lastName: "hooks",
occupation: "writer",
age: 64,
alive: true
}
alive: true,
},
];

writers.forEach(function (writer) {
console.log(
`"Hi, my name is ${writer.firstName} ${writer.lastName}. I am ${writer.age} years old, and work as a ${writer.occupation}."`
);
});
/*
If you want an extra challenge, only `console.log()` the writers that are alive.
*/

writers.forEach(function (writer) {
if (writer.alive === true) {
console.log(`The writer ${writer.firstName} ${writer.lastName} is alive`);
}
});
11 changes: 7 additions & 4 deletions Week-1/Homework/mandatory/2-water-bottle.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@ We made a start on this for you here:

let bottle = {
volume: 0,
fill: function() {
fill: function () {
// calling this function should make you bottles volume = 100;
bottle.volume = 100;
},
drink: function() {
drink: function () {
// calling this function should decrease your bottles volume by 10;
bottle.volume = 10;
},
empty: function() {
empty: function () {
// this function should return true if your bottles volume = 0
}
bottle.volume = 0;
},
};

/*
Expand Down
6 changes: 6 additions & 0 deletions Week-1/Homework/mandatory/3-groceries.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ let groceryList = {
item2: "",
item3: ""
};

for (let grocery in groceryList) {
groceriesToBuy.push(groceryList[grocery]);
}

console.log(groceriesToBuy);
3 changes: 3 additions & 0 deletions Week-1/Homework/mandatory/4-codewars.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ Exercises:
- [Crash Override](https://www.codewars.com/kata/crash-override/train/javascript)
- [Job Matching #1](https://www.codewars.com/kata/56c22c5ae8b139416c00175d/train/javascript)
- [Split the Bill](https://www.codewars.com/kata/5641275f07335295f10000d0/train/javascript)


Codewar solutions link: https://www.codewars.com/users/edksam/completed_solutions