How to iterate (keys, values) in JavaScript?
tl;dr In ECMAScript 2017, just call Object.entries(yourObj). In ECMAScript 2015, it is possible with Maps. In ECMAScript 5, it is not possible. ECMAScript 2017 ECMAScript 2017 introduced a new Object.entries function. You can use this to iterate the object as you wanted. Output ECMAScript 2015 In ECMAScript 2015, there is not Object.entries but you can use Map objects instead and iterate over them …