0

I would like to know more about the internal workings of JavaScript to better understand what is happening.

With the following object

let test = {"A": 10,"D" : 6, "PP" : 777};

console.log (test["PP"]): // 777

console.log (test.PP): // 777

How does JavaScript find my value with potential N element in the object?

My question is about the inner workings.

Imagine an object with 100,000 properties how will it find the key "PP" what job will it do? How does JS work to give us the value 777?

Heretic Monkey
  • 11,687
  • 7
  • 53
  • 122
  • There are two ways to access object properties: the `[ ]` operator, and (for properties whose names are suitable) the `.` operator. Both do the same thing. – Pointy Feb 08 '22 at 14:01
  • 1
    "how he find": is your question about how JavaScript stores objects? Or about the syntax to retrieve a value? Or...? – trincot Feb 08 '22 at 14:03
  • My English is not very good, my question is about the inner workings. Imagine an object with 100,000 properties how will it find the key "PP" what job will it do ? how JS work for to give us the value 777 ? – Rayan arnel Feb 08 '22 at 14:10
  • Is that *really* what you want to know? Well, okay… https://stackoverflow.com/q/6586670/476 – deceze Feb 08 '22 at 14:13
  • thx you ,exactly – Rayan arnel Feb 08 '22 at 14:16

0 Answers0