This is the code I used, however, I keep getting syntax error.
function iterateOverObject(obj) {
foreach (const value in obj[key, value]) {
console.log(obj[value]);
}
}
Try this:
function iterateOverObject(obj) {
for (const key in obj) {
console.log(obj[key]);
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.