One interesting thing I've noticed about TypeScript is that it allows me to use bracket notation to access an object via index, even when it only has keys. For example:
interface testObject {
name: string;
id: number;
}
let first: testObject = {name: "Marquizzo", id: 1};
let second = first[1]; // <-- Should yield error!
first[1]
should trigger an error because 1
is not a valid key in the testObject
interface. Is there a particular flag that can be activated to prevent this issue?