Repository navigation
Sprint-Challenge--JavaScript -- Borja soler - #1
borjasolerme wants to merge 8 commits into
Conversation
samarv
left a comment
There was a problem hiding this comment.
Project Overview
- Self study Questions
- Use the objects-arrays.js link to get started. Read the instructions carefully!
- Use the functions.js link to get started. Read the instructions carefully!
- Use the prototypes.js link to get started. Read the instructions carefully!
- Use the classes.js link to get started. Read the instructions carefully!
Sprint
-
Extend the base class CuboidMaker with a sub class called CubeMaker. Find out the formulas for volume and surface area for cubes and create those methods using the dimension properties from CuboidMaker. Test your work by logging out your volume and surface area.
-
If you haven't already, convert your array method callbacks into arrow functions.
Conclusion
Hey Borja,
You did superb in this sprint. Here are a few things that went well -
- Your code is clean and well thought out.
- You went above and beyond to compete all stretch task
- Your git work flow is ada grade.
Here is a few thing you need to work on -
-
You need to get more comfortable in answering questions in english. I know, english is your second language but I believe, that getting the point across in a well written format is worth the effort.
-
You used the operators with parentheses. it's works but it's not very readable. which operator get's computed first?
*or+Write your code in a way that's easy to comprehend
Keep working hard. Keep stretching. Programmer level ** 10000
if you have any questions, Don't fret to reach out to me.
| Global object (The window in browsers) when neither of the other cases is applied. | ||
|
|
||
| 5. Why do we need super() in an extended class? | ||
| Is the keyword that allow us to 'refer'/'call' the class from which is inherit. |
There was a problem hiding this comment.
The super() is used to access and call functions on an object's parent. When used in a constructor, the super keyword appears alone and must be used before the this keyword is used.
| return ( | ||
| 2 * | ||
| (this.length * this.width + | ||
| this.length * this.height + |
There was a problem hiding this comment.
what you have done is fine but yo can/should also use brackets to mark the separation between 2 operator. so, it's easier to read. you can do something like
return 2 * ((this.length * this.width) + (this.length * this.height) + (this.width * this.height));
| super(attributes, attributes, attributes); | ||
| } | ||
| volume() { | ||
| return Math.pow(this.length || this.height || this.width, 3); |
There was a problem hiding this comment.
you can also use exponential operator ** to raise the power. so, you can also do something like
return this.length ** 3
| * The last parameter accepts a callback | ||
| * In the body of the function return the callback with the two parameters that you created | ||
| */ | ||
| const consume = (param1, param2, cb) => cb(param1, param2); |
There was a problem hiding this comment.
great use of arrow function. pretty neat.
| console.log(lowerCase); | ||
| // const lowerCase = []; | ||
| // zooAnimals.map(function(animal) { | ||
| // lowerCase.push(animal.animal_name.toLowerCase()); |
There was a problem hiding this comment.
You can do something like
let lowerCase = zooAnimals.map(function (animal) {
return(animal.animal_name.toLowerCase())
}You don't need to create a new array and push in items. Map by default returns an array.
@samarv
// Finished MVP plus stretch challenges