Not so new to javascript, but the following gives an error in javascript, where as my textbook says it should work. Boolean imgDirection[] = new Boolean[60]; What's the problem?
Solution 1:
This code isn't javascript:
Boolean imgDirection[] = newBoolean[60];
If you wanted to declare a 60 element array in javascript, you could simply use this:
var imgDirection = newArray(60);
Javascript variable declarations are not typed so there is no such data declaration like Boolean imgDirection[].
Share
Post a Comment
for "An Array Of Booleans In Javascript"
Post a Comment for "An Array Of Booleans In Javascript"