Skip to content

Amir yunas - #1

Open
ayunas wants to merge 12 commits into
masterfrom
amir-yunas
Open

Amir yunas#1
ayunas wants to merge 12 commits into
masterfrom
amir-yunas

Conversation

@ayunas

@ayunas ayunas commented Mar 8, 2019

Copy link
Copy Markdown
Owner

@jheinz1999

Project ifnished! prototypes.js file not done. please see message.

@ayunas
ayunas requested a review from jheinz1999 March 8, 2019 18:51

@jheinz1999 jheinz1999 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Everything is looking really good! The only things that are missing are prototypes and the readme questions. Try your best with prototypes, and definitely use the guided project and solution code for JS 3 if you get stuck!



// tyrannosaurus, carnivorous, 7000kg, 12m, Late Cretaceious
const tyrannosaurus = {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Excellent work creating objects!

console.log(tyrannosaurus.period);


// Create a new roar method for the tyrannosaurus. When called, return "RAWERSRARARWERSARARARRRR!" Log the result.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Make sure to add the roar method!

*/
const animalNames = [];

zooAnimals.forEach( (animal,i) => animalNames.push('Name: ' + zooAnimals[i].animal_name,'Scientific: ' + zooAnimals[i].scientific_name));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Awesome that you are using arrow syntax!

Comment thread challenges/objects-arrays.js Outdated

const lowerCase = [];

zooAnimals.forEach( (animal,i) => lowerCase.push(zooAnimals[i].animal_name.toLowerCase()));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This challenge is asking you to use .map()

Comment thread challenges/objects-arrays.js Outdated
console.log(largerPopulation);

const smallerPopulation = zooAnimals.filter((animal,i) => zooAnimals[i].population < 5);
const smallerNames = smallerPopulation.map( (animal,i) => (`${smallerPopulation[i].animal_name}, Population: ${smallerPopulation[i].population}`));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It's awesome that you used .map() here for better formatting! Know that you don't need to create a separate variable here, as you can just chain the .map() method on after your .filter() method.

Comment thread challenges/functions.js
// Explain in your own words why `nestedfunction()` can access the variable `internal`.

// Explanation:
console.log(`Explanation: nestedFunction() is able to access the variable internal, even though it is outside of the function scope. This is because of the concept in javascript known as a closure. Javascript allows for this behavior in order to allow functions to behave correctly. Technically, a function cannot access variables outside of it's scope. But because of the closure, a nested function can access variables in functions outside of it, and even in the global context.\n`);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is an excellent answer!

Comment thread challenges/classes.js

class CuboidMaker {
constructor(keys) {
this.name = keys.name;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Awesome that you added an additional property here

ayunas added 2 commits March 8, 2019 17:21
…oAnimals array instead of creating another array and running an array method on each variable array.
@ayunas
ayunas requested a review from jheinz1999 March 8, 2019 23:38
@ayunas

ayunas commented Mar 8, 2019

Copy link
Copy Markdown
Owner Author

I just commited the changes that you suggested and the readme file has been pushed correctly. Please re-review. Thanks!

@jheinz1999 jheinz1999 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Excellent work! The only thing that you're missing is prototypes, which we will talk about

Comment thread README.md
@@ -29,15 +29,27 @@ Demonstrate your understanding of this week's concepts by answering the followin
Edit this document to include your answers after each question. Make sure to leave a blank line above and below your answer so it is clear and easy to read by your project manager

1. Describe the biggest difference between `.forEach` & `.map`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Excellent answers!

weight: '7000kg',
length: '12m',
period: 'Late Cretaceious',
roar: function() {return 'RAWERSRARARWERSARARARRRR!'}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Awesome work adding in the roar method!

const lowerCase = [];
//zooAnimals.forEach( (animal,i) => lowerCase.push(zooAnimals[i].animal_name.toLowerCase()));

const lowerCase = zooAnimals.map( (animal,i) => animal.animal_name.toLowerCase() );

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looking good! It doesn't look like you're using the second parameter in your callback function, so you could remove it

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