There are methods like Object.values
fo Object.keys
, but why aren't these methods inside the object's prototype? Is there a good reason for this?
Example:
const user = { name: 'John', role: 'admin' };
const keys = user.keys() // instead of Object.keys(user);
const values = user.values() // instead of Object.values(user);