Reputation: 4231
Why do I have to cast function into Function
type to be able to access apply
and other members?
var a: Function = () => {};
a.apply(); // works
var a = () => {};
a.apply(); // does not work
How should I do it with these functions?:
function a(){}
a.apply(); // does not work
Upvotes: 1
Views: 773
Reputation: 251222
If you pass the "this" argument to the apply
function, it seems to work either way:
var a = () => {};
a.apply(null);
var b: Function = () => {};
b.apply(null);
Upvotes: 1