Skip to content

Commit 29e540d

Browse files
committed
Updated instructions and syntax in arrays.js and function conversion
1 parent 87877e0 commit 29e540d

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

assignments/arrays.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let inventory = [{"id":1,"car_make":"Lincoln","car_model":"Navigator","car_year"
77
{"id":3,"car_make":"Land Rover","car_model":"Defender Ice Edition","car_year":2010},
88
{"id":4,"car_make":"Honda","car_model":"Accord","car_year":1983},
99
{"id":5,"car_make":"Mitsubishi","car_model":"Galant","car_year":1990},
10-
{"id":6,"car_make":"Audi","car_model":"riolet","car_year":1995},
10+
{"id":6,"car_make":"Honda","car_model":"Accord","car_year":1995},
1111
{"id":7,"car_make":"Smart","car_model":"Fortwo","car_year":2009},
1212
{"id":8,"car_make":"Audi","car_model":"4000CS Quattro","car_year":1987},
1313
{"id":9,"car_make":"Ford","car_model":"Windstar","car_year":1996},
@@ -57,16 +57,14 @@ let inventory = [{"id":1,"car_make":"Lincoln","car_model":"Navigator","car_year"
5757
// Example for loop:
5858

5959
// arr = [1,2,3,4];
60-
// for (i = 0; i < arr.length; i++) {
60+
// for (let i = 0; i < arr.length; i++) {
6161
// arr[i]; // 1,2,3,4
6262
// }
6363

6464
// ==== Challenge 1 ====
6565
// The dealer can't recall the information for a car with an id of 33 on his lot. Help the dealer find out which car has an id of 33 by logging the car's year, make, and model in the console log provided to you below:
6666
console.log(`Car 33 is a *car year goes here* *car make goes here* *car model goes here*` );
6767

68-
69-
7068
// ==== Challenge 2 ====
7169
// The dealer needs the information on the last car in their inventory. What is the make and model of the last car in the inventory? Log the make and model into the console.
7270
let lastCar = 0;
@@ -84,12 +82,12 @@ console.log();
8482

8583
// ==== Challenge 5 ====
8684
// The car lot manager needs to find out how many cars are older than the year 2000. Using the carYears array you just created, find out how many cars were made before the year 2000 by populating the array oldCars and logging it's length.
87-
let oldCars =[];
85+
let oldCars = [];
8886
console.log();
8987

9088
// ==== Challenge 6 ====
9189
// A buyer is interested in seeing only BMW and Audi cars within the inventory. Return an array that only contains BMW and Audi cars. Once you have populated the BMWAndAudi array, use JSON.stringify() to show the results of the array in the console.
92-
let BMWAndAudi =[];
90+
let BMWAndAudi = [];
9391
console.log();
9492

9593

assignments/stretch-function-conversion.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
// Take the commented ES5 syntax and convert it to ES6 arrow Syntax
22

3-
// let myFunction = function () {};
3+
// let myFunction = function () {
4+
// console.log("Function was invoked!");
5+
// };
6+
// myFunction();
47

58
// let anotherFunction = function (param) {
69
// return param;
710
// };
11+
// anotherFunction("Example");
812

913
// let add = function (param1, param2) {
1014
// return param1 + param2;
@@ -16,6 +20,9 @@
1620
// };
1721
// subtract(1,2);
1822

23+
24+
// Stretch
25+
1926
// exampleArray = [1,2,3,4];
2027
// const triple = exampleArray.map(function (num) {
2128
// return num * 3;

0 commit comments

Comments
 (0)