I have the following code in Typescript. Why does the compiler throws an error?
var object = {}; Object.defineProperty(object, \'first\', {
In the given case, I would just rewrite it as
var object = {}; var withFirst = {...object, get first() {return 37;}}; console.log('first property: ' + withFirst.first);