You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.