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?

5
  • There are two ways to access object properties: the [ ] operator, and (for properties whose names are suitable) the . operator. Both do the same thing. Commented Feb 8, 2022 at 14:01
  • 1
    "how he find": is your question about how JavaScript stores objects? Or about the syntax to retrieve a value? Or...? Commented Feb 8, 2022 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 ? Commented Feb 8, 2022 at 14:10
  • Is that really what you want to know? Well, okay… 👉 stackoverflow.com/q/6586670/476 Commented Feb 8, 2022 at 14:13
  • thx you ,exactly Commented Feb 8, 2022 at 14:16

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.