Ad
Code
Diff
  • function giveItall(n){
      let a = 'abcdefghijklmnopqrstuvwxyz'
      return [...a].filter((x,i)=>i<=n-1)
      
    }
    
    console.log(giveItall(11));
    • function giveItall(n){
    • let a = 'abcdefghijklmnopqrstuvwxyz'
    • return [...a].filter((x,i)=>i<=n-1)
    • let a = [];
    • let b = 'abcdefghijklmnopqrstuvwxyz'
    • for(let i = 0; i <= n - 1; i++){
    • a.push(b[i]);
    • }
    • return a;
    • }
    • console.log(giveItall(11));

don't judge

function giveItall(n){
  
  let a = [];
  
  let b = 'abcdefghijklmnopqrstuvwxyz'
  
  for(let i = 0; i <= n - 1; i++){
    a.push(b[i]);
  }
  
  return a;
}

console.log(giveItall(11));