I have a javascript object of the following form:
{ url1: {status: "ok", updatedAt: someDate1},
url2: {status: "error", updatedAt: someDate2},
url3: {status: "error", updatedAt: someDate3},
...
}
I want to create a new object that contains all the elements which “status” property is “error”.
In the example above I want the following object to be created:
{ url2: {status: "error", updatedAt: someDate2},
url3: {status: "error", updatedAt: someDate3}
}
This should do what you need (
ois your original object):