Find a value in an array of objects in Javascript

Опубликовано: 07 Март 2023
на канале: Code Samples
247
4

#short
#javascript
#arrays
#array-of-dict
I know similar questions have been asked before, but this one is a little different. I have an array of unnamed objects, which contain an array of named objects, and I need to get the object where "name" is "string 1". Here is an example array.
var array = [
{ name:"string 1", value:"this", other: "that" },
{ name:"string 2", value:"this", other: "that" }
];

Update: I should have said this earlier, but once I find it, I want to replace it with an edited object.


Смотрите видео Find a value in an array of objects in Javascript онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Code Samples 07 Март 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 247 раз и оно понравилось 4 людям.