Javascript Uncaught TypeError: Cannot read property ‘0’ of undefined

The error is here: You are passing the first item of words, instead of the array. Instead, pass the array to the function: Problem solved! Here’s a breakdown of what the problem was: I’m guessing in your browser (chrome throws a different error), words[] == words[0], so when you call hasLetter(“a”,words[]);, you are actually calling hasLetter(“a”,words[0]);. So, in essence, … Read more

TypeError: list indices must be integers, not float

It looks like you are using Python 3.x. One of the important differences in Python 3.x is the way division is handled. When you do x / y, an integer is returned in Python 2.x because the decimal is truncated (floor division). However in 3.x, the / operator performs ‘true’ division, resulting in a float instead of an integer (e.g. 1 … Read more

Javascript Uncaught TypeError: Cannot read property ‘0’ of undefined

The error is here: You are passing the first item of words, instead of the array. Instead, pass the array to the function: Problem solved! Here’s a breakdown of what the problem was: I’m guessing in your browser (chrome throws a different error), words[] == words[0], so when you call hasLetter(“a”,words[]);, you are actually calling hasLetter(“a”,words[0]);. So, in essence, … Read more