function foo(x: Array): Array { return x.sort((a, b) => a.foo - b.foo); } // Make sure Object works with Object.keys() function bar(x: Object): Array { return Object.keys(x); }