I would think that once I created an array named letters that as soon as I typed letters. intellisense would pop up and give me options and .length would be one of the options. What I am looking for is a good javascript editor since there is not a lot of debugging support for javascript and a simple miss spell can kill and app.
Code: Select all
var ctx = theCanvas.getContext('2d'),
guesses = 0,
message = 'Guess the letter from a (lower) to z (higher)',
letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'],
today = new Date(),
letterToGuess = '',
higherOrLower = '',
lettersGuessed = [],
gameOver = false;
function initGame() {
var letterIndex = Math.floor(Math.random() * letters.length);
letterToGuess = letters[letterIndex];
window.addEventListener('keydown',eventKeyPressed,true);
drawScreen();
}