Skip to content

README Questions complete - Marcus Bass - #555

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

README Questions complete - Marcus Bass#555
marcusbass323 wants to merge 4 commits into
bloominstituteoftechnology:masterfrom
marcusbass323:master

Conversation

@marcusbass323

Copy link
Copy Markdown

@fireinjun

@mykeal-kenny

Copy link
Copy Markdown

Comprehension Questions

  • Describe the biggest difference between .forEach & .map.
  • What is the difference between a function and a method?
  • What is closure?
  • Describe the four rules of the 'this' keyword.
  • Why do we need super() in an extended class?

Objects and Arrays

  • Finish all work on: objects-arrays.js

Functions

  • Finish all work on: functions.js

Prototypes

  • Finish all work on: prototypes.js

Classes

  • Finish all work on: classes.js

@mykeal-kenny mykeal-kenny 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! Just a few things here and there to work on, but, I know it was a hard week for you.

Comment thread README.md

## Task 2: Comprehension Questions
Answer the following questions to the best of your ability. You can exercise your Googling skills and use training kit. Open up the [Answers.md](Answers.md) file and record your responses there.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Try to answer the questions in the Answers.md file next time. It will make it easier for both of us, good answers though!

Comment thread README.md
Answer the following questions to the best of your ability. You can exercise your Googling skills and use training kit. Open up the [Answers.md](Answers.md) file and record your responses there.

1. Describe the biggest difference between `.forEach` & `.map`: forEach applies to every item in an array and doesn't return anything, map returns an array of the same size.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The biggest takeaway from that should be:
forEach manipulates the array while map makes a copy.
there will be instances where you don't want to mess with the original

Comment thread README.md
1. Describe the biggest difference between `.forEach` & `.map`: forEach applies to every item in an array and doesn't return anything, map returns an array of the same size.

2. What is the difference between a function and a method? A function is used to return a value (IE string, number, etc). A method is like a function, but it's an internal part of a class.

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 README.md
2. What is the difference between a function and a method? A function is used to return a value (IE string, number, etc). A method is like a function, but it's an internal part of a class.

3. What is closure? Closure is an inner function that has access to the outer

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

How does it work? Could you explain it to a 10 year old? That's the biggest test of whether or not you get something.

Comment thread README.md

3. What is closure? Closure is an inner function that has access to the outer

4. Describe the four rules of the 'this' keyword.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Perfect! Keep these in mind as everything else will build on these concepts. THIS, while being ridiculous in it's own way, will definitely make things easier to understand later on.

Comment thread README.md
3 - When a dot is to the left of a function invocation, this is the object to the left of the dot
4 - A function without any conditions is the global object or in a browser, a window.

5. Why do we need super() in an extended class? That's the proper way to call functions on the object's parent? Super is used for when you want to use the methods and properties of parent class.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Partially, but good enough for a working understanding. I would recommend reading up on the concept as it's very much an important thing to know.

Comment thread challenges/classes.js
}
// Getter
get volume() {
return this.calcArea();

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 works! But, the function name is misleading I wasn't paying attention.

Comment thread challenges/classes.js
(this.length * this.width +
this.length * this.height +
this.width * this.height)
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

consider refactoring for a cleaner flow. while it does work and it does make sense, I think you can make it look better.

// How long was a stegosaurus?
var stegosaurus = {diet:"herbivorous", weight:"2000kg", length: "9m", period: "Late Jurassic"};
console.log(stegosaurus.length);
// What time period did tyrannosaurus live in?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice object creation!

Comment thread challenges/prototypes.js
Add properties and values of length: 4, width: 5, and height: 5 to cuboid.
*/
Create a cuboid object that uses the new keyword to use our CuboidMaker constructor
Add properties and values of length: 4, width: 5, and height: 5 to cuboid.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Work on your prototypes a little more maybe? Please hit me up if you don't understand!

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