As I delved into the world of JavaScript, I encountered a code snippet that had me stumped. No matter how hard I tried to analyze and compile it, I kept running into an issue - an Uncaught SyntaxError: Unexpected number. Has anyone else faced this problem before? Can you help me figure out what's going wrong?
// Draw as many cats as you want!
var drawCats = function (howMany) {
for (var i = 0; i < howMany; i++) {
console.log(i + " =^.^=");
}
};
EDIT: Of course, I replaced "howMuch" with a number.
// Draw as many cats as you wish!
var drawCats = function (10) {
for (var i = 0; i < 10; i++) {
console.log(i + " =^.^=");
}