Is there a way to use a fat arrow with an object?
The following code prints out the contents of the array "test" in the console.
//With array
let test = [1, 2, 3, 4];
test.forEach(number => console.log(number));
I'm looking for a way to have the same output but with "test" being an object, not an array (like below). is there a (relatively) simple way of doing this?
//With object
let test = {
a: 1,
b: 2,
c: 3,
d: 4
}
test.forEach(number => console.log(number));