Skip to content

SprintWk3 - #1

Open
HeyClos wants to merge 10 commits into
masterfrom
carlos
Open

SprintWk3#1
HeyClos wants to merge 10 commits into
masterfrom
carlos

Conversation

@HeyClos

@HeyClos HeyClos commented Apr 5, 2019

Copy link
Copy Markdown
Owner

No description provided.

@HeyClos
HeyClos requested a review from BrannanC April 5, 2019 16:15
@byronholmes2018

byronholmes2018 commented Apr 6, 2019

Copy link
Copy Markdown

functions.js
Your HOFs and callbacks are correctly written.
Your answer to the closures question is basically correct, but be careful. It is not the fact that both
internal and nestedFunction() live in the scope of myFunction(). Rather, it is the fact that internal is outside the scope of nestedFunction(), which is a closure. If nestedFunction() had another function inside it, it could not access the variables inside that function. On the other hand, consider:

const outermost = "outermost"

 function outerFunc(){
  const outer = "outer"
  function innerFunc(){
    const inner = "inner"
    console.log(inner)
    console.log(outermost)
  }
  innerFunc()
  
}
outerFunc();

Here, even though outermost lives not in the same scope as innerFunc() and outer, innerFunc() can still access outermost (you can try running this in codepen to test it out).

objects-arrays.js
Your objects are done exactly right.
Your use of dot notation to access object properties is exactly right.
Your Arrays exercise requests 1-3 are exactly right.
On the advanced Arrays exercise, requests 1 and 2 are fine. While 3 demonstrates essentially the right idea, you will notice in the console that you get output from line 169 which is an array with 10 items, all booleans. Instead of returning the elements of zooAnimals that pass the test i.population < 5*, you pushed the direct result of the test** onto a second array, largerPopulation, which you logged to the console.
Request 4 is great.

prototypes.js
Everything looks good until line 40. It looks like you were trying to make a subclass of CuboidMaker, but you didn't write an object constructor for the subclass. That's probably why you get the error 'cuboid' is not defined. In this case, it would have been better to stick to using the new keyword as we learned in lecture and in TK.

classes.js
You did a great job defining the class, but you did not instantiate the class via an object 'cuboid'. It appears that you didn't uncomment the tests on lines 19 and 20, but if you had, you'd again get the error that cuboid is not defined, this time, because you didn't create the object named 'cuboid'.

Unfortunately, MVP was not met in three files: objects-arrays.js, prototypes.js and classes.js. 1

*which would then be pushed onto the new array generated by .filter()
**recall < is a comparison operator, and its output a boolean.

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