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

296
Vistas
Is it possible to pass a primitive value (number or string) by reference in the parameters of a function in JavaScript?

Is this possible? My purpose is to pass text variables and / or numbers with large sizes, therefore, if I pass a large value to the parameters in a function call, in order to make validations (validate messages, scores , etc. of great length) Is this value copied ?, that is, Would it be using twice the memory ?, Does JavaScript at this point do any String Interning or references for the primitive values internally?

For example, strings are immutable, therefore, wouldn't it be silly to pass a copy in the parameters, or if they are passed by reference?

In the case of numbers, likewise, if I only want to use (not manipulate) a number inside a function, is this number also passed as a copy or is it a reference internally?

So is this possible in JavaScript?

Hope you can help me understand c:

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