Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • I get this error: Uncaught TypeError: Cannot call method 'indexOf' of undefined . I don't quite understand where and how you defined limitsArray. Commented Sep 14, 2013 at 18:40
  • its an argument into the function so you would create that outside the scope of the function to track it. So outside that function create an array like var usedElements = new Array(); The pass that into the function. Then every time you get a random var back, do a push into that usedElements array like usedElements.push(<FOO>); Commented Sep 14, 2013 at 18:43
  • Could you please elaborate on this in your post, I'm really stuck and am not experienced enough with arrays to do this. Thank you for your effort. Commented Sep 14, 2013 at 18:53