You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constwyoming: TState={name: 'Wyoming',capital: 'Cheyenne',population: 578_000// ~~~~~~~ Object literal may only specify known properties,// and 'population' does not exist in type 'TState'};
interfacePerson{name: string;age: string;}typeTPerson=Person&{age: number;};// no error, unusable typeinterfaceIPersonextendsPerson{// ~~~~~~~ Interface 'IPerson' incorrectly extends interface 'Person'.// Types of property 'age' are incompatible.// Type 'number' is not assignable to type 'string'.age: number;}
// lib.es2015.core.d.tsinterfaceArray<T>{/** Returns the index of the first element in the array where predicate... */findIndex(predicate: (value: T,index: number,obj: T[])=>unknown,thisArg?: any): number;// ... also find, fill, copyWithin}
exportfunctiongetHummer(){// ~~~~~~~~~// Return type of exported function has or is using private name 'Hummingbird'.interfaceHummingbird{name: string;weightGrams: number;};constbee: Hummingbird={name: 'Bee Hummingbird',weightGrams: 2.3};returnbee;};