Joshua Gonzalez - JavaScript-II - #466
Open
CatsAreMLG wants to merge 9 commits into
Open
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
JavaScript - II
With some basic JavaScript principles in hand, we can now expand our skills out even further by exploring callback functions, array methods, and closure. Finish each task in order as the concepts build on one another.
Task 1: Set Up The Project With Git
console.log()statements, open up the index.html file found in the assignments folder and use the developer tools to view the console.Task 2: Callbacks
This task focuses on getting practice with callback functions by giving you an array of values and instructions on what to do with that array.
Review the contents of the callbacks.js file. Notice you are given an array at the top of the page. Use that array to aid you with your callback functions.
Write out each function using the
ES5functionkeyword syntax.Solve the problems listed. Save the stretch problems until you have completed Tasks 1-4.
Task 3: Array Methods
Use
.forEach(),.map(),.filter(), and.reduce()to loop over an array with 50 objects in it. The array-methods.js file contains several challenges built around a fundraising 5K fun run event.Review the contents of the array-methods.js file.
Complete the problems provided to you
Notice the last three problems are up to you to create and solve. This is an awesome opportunity for you to push your critical thinking about array methods, have fun with it.
Task 4: Closures
We have learned that closures allow us to access values in scope that have already been invoked.
Hint: Utilize debugger statements in your code in combination with your developer tools to easily identify closure values.
Stretch Goals
Arrow Function Syntax - Check out this awesome guide for ES6 arrow syntax. You will see more and more arrow functions as you progress deeper into JavaScript. Use the stretch-function-conversion.js file as a helper challenge to showcase some of the differences between ES5 and ES6 syntax.
Look up what an IIFE is in JavaScript and experiment with them