Answer the question
In order to leave comments, you need to log in
Filter multidimensional JSON array in vanilla JavaScript?
Good time!
There is such an array that arrives from the backend via the REST API (tourist industry):
[
{
"id": 1,
"resort": "Сочи",
"hotels": [
[4, 100, 8100],
[3, 80, 5399],
[5, 20, 15399],
[4, 180, 8399],
]
},
{
"id": 2,
"resort": "Пхукет",
"hotels": [
[1, 30, 10570],
[3, 50, 12799],
]
},
// ...ещё около 50 стран...
]
hotels
contains hotels of this resort with information (let's take the first one as an example):...
[
4, // кол-во звёзд отеля
100, // кол-во номеров
8100 // средняя стоимость номера
],
...
I want to get the room rate in the Sochi resort, a 4 star hotel, where the number of rooms is 100.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question