I am learning NodeJs 12 with Promise.allSettled() function and its usage.
I have written the following code. I am able to print the status in the console but unable to print the value as it is giving compilation issue.
const p1 = Promise.resolve(50);
const p2 = new Promise((resolve, reject) =>
setTimeout(reject, 100, 'geek'));
const prm = [p1, p2];
Promise.allSettled(prm).
then((results) => results.forEach((result) =>
console.log(result.status,result.value)));
I am getting the following compilation issue.

I provide below the tsconfig.json.
{
"compilerOptions": {
"target": "es2017",
"lib": ["es6","esnext", "dom"],
"allowJs": true,
"module": "commonjs",
"moduleResolution": "node",
"declaration": true,
"outDir": "./lib",
"strict": true,
"esModuleInterop": true,
"typeRoots": [ "./types", "./node_modules/@types"]
},
"include": ["src"],
"exclude": ["**/__tests__/*"]
}
