Skip to content

Conversation

@walzer85
Copy link
Owner

@walzer85 walzer85 commented Nov 9, 2017

Checkpoint Rubric

This is the rubric that your instructor will use to grade your checkpoints. Please do not edit.

Checkpoint 1

  • All tests passed: 40 points
  • Proper use of documentation (commenting on code): 15 points
  • Properly indented code: 15 points
  • Demonstrated effective use of JavaScript: 30 points

Checkpoint 2

  • The application works as it should: 40 points
  • Proper use of documentation (commenting on code): 15 points
  • Properly indented code: 15 points
  • Demonstrated effective use of JavaScript and the DOM API: 30 points

Checkpoint 3

  • Use of React: 25 points
  • Accesses an API: 25 points
  • Proper use of documentation (commenting on code): 25 points
  • The application functions as it should: 25 points

Copy link

@reneemeyer reneemeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eric, good start, but you need to work out some of the kinks in these functions. Remember, the purpose of functions in JS is re-usability and the ability to return data. We don't want to hard code any data into a function.

function forEach(arr, callback) {
// Your code here
// create an array with whatever you want in it
const arrProblemOne = [1, 2, 3]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unnecessary.


//make a for loop that runs the number of items in the array amount of times.
//make a variable that prints a phrase the amount of times defined by the for loop
for (let i = 0; i < arrProblemOne.length; i++) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your for loop should loop around the arr that the user passes in, not a hard coded array.

//make a for loop that runs the number of items in the array amount of times.
//make a variable that prints a phrase the amount of times defined by the for loop
for (let i = 0; i < arrProblemOne.length; i++) {
callback();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each item needs to be passed into the callback.

@@ -3,15 +3,45 @@
const assert = require('assert');

function forEach(arr, callback) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

es6 syntax

function map(arr, callback) {
// Your code here
// Create an array, put whatever you want in it
const test = ['1', '2', '3', '4', '5', '6'];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is unnecessary

//doThis(), a function that creates a new array, then does whatever function you want when you call doThis to the original array
//pushes the result of the called function to the new array
//print out the new array
const doThis = (arr, callBackFunction) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the purpose of this internal function?

//print out the new array
const doThis = (arr, callBackFunction) => {
const newArr = [];
test.forEach((i) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your forEach should loop around the array passed, not a hardcoded array.

test.forEach((i) => {
newArr.push(callBackFunction(i));
});
console.log(newArr);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should return the newArr, not console log it

//a new, empty array accepts the results of the function
const filtered = (arrTwo, callbackTwo) => {
const arrResultThree = [];
if (callbackTwo(arrTwo[i])) arrResultThree.push(arrTwo[i])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is i defined? This doesn't make any sense. Also where did longestWords come from? Please follow the exact directions. This function should take an array and a function as arguments. It should return an array with only the items that return true in the function. Don't use hard coded arrays or functions.

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.

3 participants