Declaring 'const' works when implementing this inferface but 'let' does not? Why?

Viewed 30

I come across a strange question here: Why is const working, but let not working here? enter image description here

interface Foo<T> {
    (arg: T): void;
    id: T;
}
const foo: Foo<number> = function(x) { console.log(foo.id+x); } //now this works
// let foo: Foo<number> = function(x) { console.log(foo.id+x); } // why can't we change const to let?
foo.id = 100;
foo(2);
0 Answers
Related