There seems to be an issue with the code snippet below when run in the TypeScript playground:
interface Person {
name: string;
age: number;
}
const makePerson= function(name : string, age : number) : Person {
let obj = <Person>{}
obj.name = name;
obj.age = age;
return obj
}
An error is shown with a red squiggly line under 'person' where it says let obj = <Person>{}
Typically, I use this method to create objects that adhere to an interface without any issues. What could have changed in the language or possibly broken in the playground? Also, why does the error mention React? You can refer to the screenshot for more details.