Skip to content

Sagar Desai - #36

Closed
sagardesai90 wants to merge 4 commits into
bloominstituteoftechnology:masterfrom
sagardesai90:master
Closed

Sagar Desai#36
sagardesai90 wants to merge 4 commits into
bloominstituteoftechnology:masterfrom
sagardesai90:master

Conversation

@sagardesai90

Copy link
Copy Markdown

No description provided.

@sagardesai90 sagardesai90 changed the title sagar Desai Sagar Desai Apr 16, 2018
Comment thread assignments/arrays.js
console.log(`Car 33 is a *car year goes here* *car make goes here* *car model goes here*` );

for (i = 0; i < inventory.length; i++){
if (inventory[i].id == 33){

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done, 👍

Comment thread assignments/arrays.js
for (i = 0; i < inventory.length; i++){
carModels.push(inventory[i].car_model);
}
console.log(carModels.sort());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread assignments/arrays.js
let carYears = [];
console.log();
for (i = 0; i < inventory.length; i++){
carYears.push(inventory[i].car_year);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread assignments/arrays.js
console.log();
for (i = 0; i < carYears.length; i++){
if (carYears[i] < 2000){
oldCars.push(carYears[i]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread assignments/arrays.js
let BMWAndAudi =[];
console.log();
for (i = 0; i < inventory.length; i++){
if (inventory[i].car_make == "BMW" || inventory[i].car_make == "Audi"){

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I think you're solid on these topics.

Comment thread assignments/callbacks.js

function firstItem(arr, cb) {
// firstItem passes the first item of the given array to the callback function.
const callbacks1 = function(item){

@ghost ghost Apr 17, 2018

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it so much easier if you compose an actual callback to use cb? 👍

Comment thread assignments/callbacks.js
// Pass true to the callback if it is, otherwise pass false.
for (let i = 0; i < list.length; i++){
if (list[i] == item){
cb(true);

@ghost ghost Apr 17, 2018

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know what, we should have added a break or a return in that if statement.
I'm sorry I didn't see this sooner.

Comment thread assignments/callbacks.js
console.log(arr2);
let res = [];
for (i = 0; i < arr2.length; i++){
if (res.includes(arr2[i]) != true){

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strech you to try using the includes that you build but it would work similarly. 👍

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done. 👍

@ghost

ghost commented Apr 18, 2018

Copy link
Copy Markdown

Great job man thank you for updating.

@mixelpixel mixelpixel closed this May 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants