Skip to content

Daren Larson - #454

Open
darenlarson wants to merge 4 commits into
bloominstituteoftechnology:masterfrom
darenlarson:master
Open

Daren Larson#454
darenlarson wants to merge 4 commits into
bloominstituteoftechnology:masterfrom
darenlarson:master

Conversation

@darenlarson

Copy link
Copy Markdown

No description provided.

@darenlarson darenlarson reopened this Oct 15, 2018

@ashwins93 ashwins93 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.

Good job. You hit the stretch. Keep it up.

Comment thread assignments/arrays.js
let lastCar = 0;
console.log();

let lastCar = inventory.length - 1;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good use of the lastCar variable, which caused a lot of confusion.

Comment thread assignments/arrays.js
for(let i = 0; i < inventory.length; i++) {
carModels.push(inventory[i].car_model);
}
let sortedCarModels = 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.

sort function actually mutates the original array. What it means is that you don't need to store the return value of the sort function in another variable. As a matter of fact sort function returns the original array i.e. in this case sortedCarModels === carModels would return true.

Comment thread assignments/objects.js
}

// Write your intern objects here:
const Mitzi = {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It is conventional to use camelCase for variable names. Why does it matter? Conventions allow for better communication between developers. If you see a camel-cased variable you know that the developer probably intended it to be the name of a function or a variable. PascalCase is used for naming special functions called constructor functions. You will learn more about this soon.

Comment thread assignments/objects.js

// Antonietta loves math, give her the ability to multiply two numbers together and return the product. Use the console.log provided as a hint.
//console.log(antonietta.multiplyNums(3,4));
Antonietta.multiplyNums = function(parameter1, parameter2) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Using descriptive names instead of parameter1 will add to better documentation.

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