arreach
Do something with each matching key in an array of objects.
Usage
const arreach = ; let arr = name: 'Dog' sound: 'Woof' name: 'Duck' sound: 'Quack' name: 'Cat' sound: 'Meow' ; ;
The above snippet would have the following output:
On the farm there is a: Dog
On the farm there is a: Duck
On the farm there is a: Cat
You can also get the parent object with an optional obj
parameter on the callback:
;
The above snippet would have the following output:
On the farm there is a: Dog... Woof!
On the farm there is a: Duck... Quack!
On the farm there is a: Cat... Meow!