Object.prototype.sortedKeys = function() { const thisKeys = [] for (const key in this) { if (Object.prototype.hasOwnProperty.call(this, key)) { thisKeys.push(key) } } thisKeys.sort() return thisKeys}a = {name: 'name', aName: 'aname', zName: 'zname'}a.sortedKeys()// ["aName", "name", "zName"]


