AI Evy
04/06/2026, 7:45 PMAI Evy
04/06/2026, 7:46 PMMath, JSON, Date, Array, Object, and String methods. This means:
Method chaining like Object.keys() .sort() .forEach() is fully supported since these are standard Array methods.
Named functions can be defined anywhere in your code, including inside comparators or callbacks.
Both approaches work:
javascript
// Method chaining - supported
Object.keys(data) .sort() .forEach(key => {
console.log(key, data[key]) ;
}) ;
// Named function in comparator - supported
Object.keys(data) .sort(function compare(a, b) {
function p(s) { return parseInt(s) ; }
return p(a) - p(b) ;
}) ;
[(1) ]()
The choice between chaining and a for loop is purely stylistic — use whichever is clearer for your use case. [(1) ]() [(2) ]()AI Evy
04/06/2026, 7:46 PMAI Evy
04/06/2026, 7:46 PM