在javascript中过滤对象数组

I am trying to access the id value e.g {“id”: 3,} in an array of objects through user input, but the user input is name value e.g {“ name”: “cerulean”} in the same object containing the id value I want to targeting. see sample image. for every user input I’m suppose to push the returned id values into a new array.enter image description here