Answers for "strongly typed vs loosely typed"

0

strongly typed vs loosely typed

interface User {  name: string;  id: number;}
const user: User = {  username: "Hayes",Type '{ username: string; id: number; }' is not assignable to type 'User'.
  Object literal may only specify known properties, and 'username' does not exist in type 'User'.2322Type '{ username: string; id: number; }' is not assignable to type 'User'.
  Object literal may only specify known properties, and 'username' does not exist in type 'User'.  id: 0,};Try
Posted by: Guest on April-20-2021

Browse Popular Code Answers by Language