fork download
  1. let suma = 0;
  2. function sumarImpar (n){
  3. for(let indice = 1 , impar = 1 ; indice <= n ; indice++ , impar += 2){
  4. suma += impar;
  5. }
  6. return suma;
  7. }
  8. console.log(sumarImpar (4));
Success #stdin #stdout 0.03s 16524KB
stdin
Standard input is empty
stdout
16