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

183
Vistas
Data types, values and objects

I'm getting pretty confused about this data type thing, especially with objects.

I read that a data type is basically an attribute for information/data used in our programs that tell the interpreter what operations can be done with that information without causing errors. Hence, every piece of information has an associated data type.

JS has 7 primitive data types and the data type Object.

Now, suppose that I write:

let person = {
   name: "John",
   age: 39,
};

Every article I found on the web says that person is a variable that store an object.

That's what gets me confused.What I'm asking is, wouldn't be more correct to say that "person is a variable that refers to a value whose data type is Object"?

I'm sure this is just overthinking the topic, however I want to get the correct basics of programming before moving on.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I think you are way overthinking it for now... Without much talking about typing, because there's much more to it than just Object. Also know that in Javascript, every value is an object, or almost.

What's good to figure out though, as you mentioned: person is a variable that refers to a value.

This is important, that makes all this more obvious:

let person = {name:"John",age:39};
let john = person;
john.age++; // Increase john's age by 1.
console.log(person.age); // 40

As you can see, person and john both refer to the same object. Untill I put another reference on them:

let person = {name:"John",age:39};
let john = person;
john.age++; // Increase john's age by 1.
console.log(person.age); // 40
person = {name:"Mary",age:34};
console.log(john.name) // John

Here, we replace the reference on person. john remains the same. Now both variable have "diverged" from each other.

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