EN
Object.entries() in TypeScript not working
1
answers
7
points
As in topic.
I thought that TypeScript supports by default Object.entries(object)
.
1 answer
5
points
I am almost 100% sure that you don't have defined es2017.object
lib in tsconfig.json
.ECMAScript 2017 (ES8) intoduced Object.entries(object)
.
Example tsconfig.json
file:
{
"version": "4.0.3",
"compilerOptions": {
"strict": true,
"target": "es5",
"module": "amd",
"composite": false,
"declaration": false,
"lib": ["es2015.promise", "es2017.object", "dom", "es5"],
"allowJs": true,
"removeComments": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"preserveConstEnums": true,
"strictBindCallApply": true,
"sourceMap": true
},
"include": [
"src/**/*.ts"
],
"exclude": [
"src/**/*.d.ts"
]
}
Or you can use all es2017
set ("lib": ["es2015.promise", "es2017", "dom", "es5"]
).
0 comments
Add comment