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

108
Vistas
Factorial push to array

I'm making a factorial. How do I push specific number to an array? For example if we factor a 14 then the result will be 1, 2, 7, 14 then I only want to push 2 and 7 to the array. Another example is if we factor 18, then the values that I want to push is only 2, 3, 6, 9. I want to exclude the 1 * 14 or 1 * 18. How can I do that?

const isNFactored = function(value, number) {
    let i;
    let array = [];
    for(i = 1; i <= value; i++) {
        if(value % i === 0) {
            array.push(i);
        }
    }
    
    console.log(array);
}
about 4 years ago · Juan Pablo Isaza
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