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

111
Vistas
How do I get results?

I am a beginner in JavaScript and I write the following code, I also write console.log(), and I do not get results, can someone help me and explain to me why I can't get results?

function integers() {
    let MyArray;
    MyArray = [];

    for (let i = 2; i <= 10; i++) {
        MyArray.push(i);
    }
    console.log(MyArray);
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The javascript functions are not being called automatically. If you need to do so, You can create an auto call function - https://stackoverflow.com/a/10704006/7078456

Or you can manually call your function to get the output of your function.

function integers() {
    let myArray = [];

    for (let i = 2; i <= 10; i++) {
        myArray.push(i);
    }

    console.log(myArray);
}

integers()
about 4 years ago · Juan Pablo Isaza 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