From c368c50a7a77dca2b8c17ffd79f877422f3fc60c Mon Sep 17 00:00:00 2001 From: Shahzad Choudhary Date: Fri, 6 Dec 2019 09:40:52 -0600 Subject: [PATCH 1/2] checkpoint --- fundamentals.js | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/fundamentals.js b/fundamentals.js index e3877d9..ac27c9a 100644 --- a/fundamentals.js +++ b/fundamentals.js @@ -3,29 +3,34 @@ // #1: Create an array of strings called `foods` that contains three foods. // Type your solution immediately below this line: - - +var foods = ["Mango", "Chocolate", "Bannnana"] +// for (var i = 0; i < foods.length; i++){ +// console.log(foods[i]) +// } // #2: Access the last item in the array and assign to a variable called `last`. // Type your solution immediately below this line: - - - +var last = foods[2] +//console.log(last) // #3: Create an empty array called `favoriteFoods`. // Type your solution immediately below this line: - - - +var favoriteFoods = [] +//console.log(favoriteFoods) // #4: Create a `for` loop that adds each string in `foods` to `favoriteFoods`. // Type your solution immediately below this line: - - - +favoriteFoods.push(foods) +for (var i = 0; i < favoriteFoods.length; i++){ + console.log(favoriteFoods[i]) +} // #5: Create an object literal called `instructor` that contains three key-value pairs. // Type your solution immediately below this line: - - +var instructor = { + firstName: "Joe", + lastName: "Koehan", + location: "New York" +} // #6: Add a `has-office-hours` (spelled exactly) property to `instructor` by accessing // it (do not change the original object you typed above) and assigning it // a boolean value. // Type your solution immediately below this line: +instructor[has-office-hours] = true From dbc3104bc30f064df5a10102c1e3057828bf9ca0 Mon Sep 17 00:00:00 2001 From: Shahzad Choudhary Date: Fri, 6 Dec 2019 10:03:12 -0600 Subject: [PATCH 2/2] checking --- hof.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hof.js b/hof.js index c8d3baa..02e79ac 100644 --- a/hof.js +++ b/hof.js @@ -20,9 +20,12 @@ var people = [ // person in the `people` array. Assign the returned array to a variable // called `peopleNames`. // Type your solution immediately below this line: +var peopleNames = [] +peopleNames = people.map(people[0].name) +return peopleNames - +//console.log(peopl[0].name) // #2: Use the `filter` array method to create a new, filtered array containing only // persons from the `people` array who know multiple languages. Assign the returned array // to a variable called `polyglotPeople`.