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

112
Vistas
Exported Variable Is Undefined

context:

  • object named multiVerse that I need to access in another file that isn't server.js (main file)

  • using module.exports={multiVerse} in server.js

  • requiring the main file using const {multiVerse} = require('./server.js');

  • when using function to arrange object (made in the same file I require main, calling its class as module on server.js) it tells me multiVerse is undefined

  • when requiring the class into server.js to use arrangeBodies() I am doing const NBody = require('./nbody') const nbody = new NBody(); before the multiVerse object is initialized

questions:

Am I exporting it correctly? Why am I getting undefined?

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