Tell us what’s happening:
Hi. I solved this tricky challenge by writing: i = len, i < len although when I set it to i <= len it rised an error while they have the same syntax meaning. If it is not JavaScript ugliness, what could we call it?? I just don’t know why big tech companies didn’t start thinking to replace this ugly and complicated syntax language. Glory to Python!
Your code so far
function countToFive() {
let firstFive = "12345";
let len = firstFive.length;
// Only change code below this line
for (let i = 0; i = len, i < len; i++) {
// Only change code above this line
console.log(firstFive[i]);
}
}
countToFive();
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36 Edg/81.0.416.68
.
Challenge: Catch Off By One Errors When Using Indexing
Link to the challenge: