I have a function like this:
private myFunc = (myNumber: number) => {
if (myNumber === 1) {
console.log('here');
}
}
Where myNumber is 1, I don't get the console output. From having a look at the console, I can see that myNumber is being treated as a different type (string). Changing the code like this works:
private myFunc = (myNumber: number) => {
if (myNumber == 1) {
console.log('here');
}
}
I was under the impression that Typescript would issue a 'compile' error in this case, but it doesn't seem to. Can anyone tell me why?