C
C
chelnokov_a2021-07-16 14:48:10
JavaScript
chelnokov_a, 2021-07-16 14:48:10

If the way to iterate over an object with this property is = options[788085][]: (2) ["7222652", "8237257"]?

There is an object

obj = {
    options[788085][]: (2) ["7222652", "8237257"]
}


I need to reach the values ​​somehow.
Help)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Egor Zhivagin, 2021-07-16
@Krasnodar_etc

I read fortunes on the coffee grounds and saw there that you mean the following structure (because the code you provided is not valid):

obj = {
 options: { // или тут массив с примерно миллионом элементов
    788085: ["7222652", "8237257"]
  }
};

// Тогда вот так:
obj.options[788085].forEach(item => console.log(item));
// Или, возможно, так:
obj[options[788085]].forEach(item => console.log(item));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question