Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

201
Vistas
Pushing and Incrementing the value in an array using a function

I am learning through an online course but the instructor computers seems to return the output as expected whereas my computer simply doesn't return me anything. also tried using online compilers

I am trying to make a "FizzBuzz" program. Thanks for help anyways

var output = [];

var count = 1 ;

function fizzBuzz() {
output.push(count);
 count++;

console.log(output);


}
about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

call fizzBuzz() at the end of the script :) also keep in mind that after the execution you will have [ 1 ] cause you're pushing the value before incrementing

the code:

var output = [];

var count = 1 ;

function fizzBuzz() {
output.push(count);
 count++;

console.log(output);


}
fizzBuzz()
about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda