There is flag strictBindCallApply in tsconfig.json
consider code below
function fn(x: string) {
return parseInt(x);
}
const n1 = fn.call(undefined, "10");
const n2 = fn.call(undefined, false);
Here in last call passed false as argument to fn function call
its actual expected type is string.so it will give an error.
No comments:
Post a Comment