4👍
✅
Array from creates an array from an iterable, which does not work on plain objects.
The Array.from() static method creates a new, shallow-copied Array instance from an array-like or iterable object.
You could use Object.values
, Object.entries
or Object.keys
Object.values(this.user).forEach((value) => {
console.log(value)
});
0👍
The Array.from()
cannot create an array from your object. Instead of it, you could just use the old simple way:
for (const key in this.user) {
console.log(this.user[key]);
}
Source:stackexchange.com