JS

TypeScript Quiz - assignments generate type errors

6.

Will the following assignments generate any type errors?

   let num: number = 5;
   let str: string = "hello";
   let bool: boolean = true;
   let arr: number[] = [1, 2, 3];
   let obj: { name: string, age: number } = { name: "John", age: 25 };

Yes, the assignment of obj should be number and string.

Yes, the assignment of str should be number.

Yes, the assignment of num should be string.

No, all assignments are type-safe.