View Single Post
  #9 (permalink)  
Old September 18th, 2012, 07:57 PM
bitnap bitnap is offline
Authorized User
Points: 105, Level: 2
Points: 105, Level: 2 Points: 105, Level: 2 Points: 105, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2010
Posts: 19
Thanks: 0
Thanked 4 Times in 4 Posts
Default

It looks like there might be an error in the answers to the exercise. The split() should say something more like this:

var tieBreakerWords = tieBreaker.split(" ");

This would split the words entered into an array every time there is a space, then the tieBreakerWords.length looks for the number of items in the array (if it is more than 20 then the error is shown).
Reply With Quote