Rosetta Code Challenges - Generate lower case ASCII alphabet

Tell us what’s happening:

My solution is running perfectly on the browser console but not here. Resetting the lesson didn’t help. Please help

Your code so far

function lascii(cFrom, cTo) {
  arr = [];
  for(let i = cFrom.charCodeAt(0); i <= cTo.charCodeAt(0); i++)
  {
    arr.push(String.fromCharCode(i));
  }
  return arr;
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36

Challenge Information:

Rosetta Code Challenges - Generate lower case ASCII alphabet

The fCC tests all run in strict mode so your code is generating an error because the arr variable is not declared with a let keyword.

Ok thank you. Added a scope type and it worked

1 Like