find angular code example
Example 1: array find
const array1 = [5, 12, 8, 130, 44];
const found = array1.find(element => element > 10);
console.log(found);
// expected output: 12
Example 2: .find angular how does it work
this.attr_0 = this.attr_1.find(x => x.id === someId);
// .find() works like a foreach loop here,
// it'll look inside of the this.attr_1 (array)
// and return on the condition (x.id === someId)