I am seeking assistance in verifying the presence of a specific value within an object.
My Object = (vagas.etapas)
"Etapas" : {
"05daf060-87cb-47cf-8c98-65b36941613d" : "Name 1",
"0bf7aabf-42df-4f7d-86dc-af81e6cef394" : "Name 2",
"13f8ebda-2b0b-4868-b856-1c88b405d853" : "Name 3",
"25b9370e-8bf3-464f-ae7c-e72937d2c490" : "Name 4",
"5a1dfca0-d0b0-4cf7-bc34-12050bafc495" : "Name 5"
},
For example, I want to check if "Name 3" exists in the array
The properties are randomly generated, and I need to find a solution without hardcoding them like this:
for (let e of Object.keys(vaga.Etapas)) {
if (vaga.Etapas[e].hasOwnProperty("13f8ebda-2b0b-4868-b856-1c88b405d853")) {
// do something
}
How can I achieve this using a for ... loop?