Ad
  • Custom User Avatar

    See the test your code fails:

    doTest(helper, 'pageIndex', -1, 40);
    

    And your code

    	pageIndex(itemIndex) {
    	// determines what page an item is on. Zero based indexes
    	// this method should return -1 for itemIndex values that are out of range
    	}
    

    It always returns undefined because there is no code there. You're working on a different method in your first post.

  • Custom User Avatar

    The error message works like this:

    pageIndex(40): expected undefined to equal -1 // <- this was the expected answer 
                                ^
    //                  Your code returned this                            
    

    And you can see that when you returned 7 instead.

  • Custom User Avatar