Quiz · Interfaces and structural typing · lesson 10 of 12
Quiz — a missing key
What does the program print?
const stock: { [item: string]: number } = { apple: 5 };
console.log(stock["pear"] + 1);What does the program print?
const stock: { [item: string]: number } = { apple: 5 };
console.log(stock["pear"] + 1);