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

312
Vistas
When I try to run the code, I get the following error "error: Uncaught ReferenceError: global is not defined"

The goal is supposed to return the reverse of an integer as long as it's smaller than 2^31-1(32-bit integers) here is the code:

var reverse = function(x) {
    let limit=Math.pow(2,31)-1;
    let r=[];
    while(x!=0){
        r.push(x%10);
        x=x%10;
    }
    let a=0;
    let n=0;
    while(r){
        a=a+r.pop()*Math.pow(1,n);
        n++;
    }
    return a<=limit ? a : 0;
    
};
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