NodeJS find object in array by value of a key [duplicate]

You can use Array.prototype.find() with pure javascript:

var picked = arr.find(o => o.city === 'Amsterdam');

It is currently not compatible with all browsers, you need to check it in your environment (but it should work in NodeJS).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)