Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

180
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!