File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55// You can use the functions that you have already written to help solve the other problems
66
77const each = ( elements , cb ) => {
8- // Iterates over a list of elements, yielding each in turn to the `cb` function.
8+ // Iterates over a list of elements, yielding each in turn to the `cb` function.
99 // This only needs to work with arrays.
1010 // based off http://underscorejs.org/#each
1111 for ( let i = 0 ; i < elements . length ; i ++ ) {
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ class User {
99// Add a method called `comparePasswords`. `comparePasswords` should have a parameter
1010 this . comparePasswords = ( potentialPassword ) => {
1111// for a potential password that will be compared to the `password` property.
12- // Return true if the potential password matches the `password` property. Otherwise return false.
12+ // Return true if the potential password matches the `password` property. Otherwise return false.
1313 if ( potentialPassword === this . password ) {
1414 return true ;
1515 } return false ;
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ const counter = () => {
55 // Example: const newCounter = counter();
66 // newCounter(); // 1
77 // newCounter(); // 2
8- // create a point for the counter to start at
98 let num = 0 ;
109 // create a function which increase num by one
1110 const addOne = ( ) => {
Original file line number Diff line number Diff line change 1010let food = 'pineapple' ;
1111
1212const isMyFavoriteFood = ( food ) => {
13- food = food || 'thousand-year-old egg' ; //This sets a default value if `food` is falsey
13+ food = food || 'thousand-year-old egg' ; //This sets a default value if `food` is falsey
1414 return food === 'thousand-year-old egg' ;
1515} ;
1616
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ const values = (obj) => {
1616} ;
1717
1818const mapObject = ( obj , cb ) => {
19- // Like map for arrays, but for objects. Transform the value of each property in turn.
19+ // Like map for arrays, but for objects. Transform the value of each property in turn.
2020 // http://underscorejs.org/#mapObject
2121 // Get the values from the obj
2222 const arrValues = Object . values ( obj ) ;
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class User {
1515 }
1616 // create a method on the User class called `checkPassword`
1717 // this method should take in a string and compare it to the object's password property
18- // return `true` if they match, otherwise return `false`
18+ // return `true` if they match, otherwise return `false`
1919}
2020
2121const me = new User ( { username : 'LambdaSchool' , password : 'correcthorsebatterystaple' } ) ;
You can’t perform that action at this time.
0 commit comments