Read these instructions carefully. Understand exactly what is expected before starting this Sprint Challenge.
This challenge allows you to practice the concepts and techniques learned over the past week and apply them in project. This Sprint explored JavaScript Fundamentals. During this Sprint, you studied array methods, this keyword, prototypes, and class syntax. In your challenge this week, you will demonstrate proficiency by completing a range of JavaScript problems.
This is an individual assessment. All work must be your own. Your challenge score is a measure of your ability to work independently using the material covered through this sprint. You need to demonstrate proficiency in the concepts and objectives introduced and practiced in preceding days.
You are not allowed to collaborate during the sprint challenge.
The index.js file contains all of your challenges. Please review it in full before answering the questions. If you complete the stretch goals please leave them in your file but commented out so that they do not affect the MVP tasks.
In meeting the minimum viable product (MVP) specifications listed below, you should have all tests passing. You can console.log to check your work and ensure you are submitting the correct results.
Set up codegrade early and commit your code regularly and meaningfully.
Demonstrate your understanding of this week's concepts by answering the following free-form questions.
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.
-
Explain the differences between
.map
,.reduce
and.filter
and describe a use case for each. .map - essentially is a copy of an array with a for loop,as a higher order function. .filter - used to loop over an array in order to return specific results. .reduce -
Explain the difference between a callback and a higher order function. A higher order function, is a function that accepts another function as one of its parameters/arguments.
A callback is reference to another function, that will later be passed in as the argument to another function.
- Explain what a closure is.
A closure is in its simplest form, a function inside of another function. What it creates, is a chain of scope, where the innermost function within the chain, will look outside of itself, to find references for variables called inside of its scope, until it reaches the outermost portion, where global scope resides.
-
Describe the four principles of the 'this' keyword. implicit binding - where whatever is to the left of the dot in the function upon invocation is what "this" is. explicit binding - used when .call and .apply is called, also unique to constrictor fucntions, it allows for the original parameters to be overriden new binding- unique to constructor functions, used to create a new instance of an object created within the constructor function. global binding - when this is accessible in global scope
-
Why do we need super() in an extended class? We need super in order to replace the need for Object.create() in es6 syntax and above.
You are expected to be able to answer questions in these areas. Your responses contribute to your Sprint Challenge grade.
Using VSCode and Command Line:
- Fork the repo
- Go into canvas and connect your repo to codegrade
- Clone your forked version of the repo
- DO NOT CREATE A BRANCH. You will be pushing your changes to the main/master today
- cd into your repo
- open the terminal in your vs code and type
npm install
- next type
npm run test
in your terminal - Complete your work making regular commits to main/master; your codegrade score will update each time you make a push.
Open a second terminal inside of your project by clicking on the split terminal icon
Inside of your second terminal type npm start
You will be running your tests in one terminal and debugging in the other. As you work on your code you should make use of console.log
to check your progress and debug.
You must complete all tasks inside of index.js
and answer the questions above.
In your solutions, it is essential that you follow best practices and produce clean and professional results. Schedule time to review, refine, and assess your work and perform basic professional polishing including spell-checking and grammar-checking on your work. It is better to submit a challenge that meets MVP than one that attempts too much and does not.
Please submit your project via codegrade by following these instructions (see part 2, submitting an assignment with codegrade).