Skip to content
Quiz · Interfaces and structural typing · lesson 10 of 12

Quiz — a missing key

What does the program print?

TypeScript
const stock: { [item: string]: number } = { apple: 5 };
console.log(stock["pear"] + 1);