Quiz: Tuples

TypeScript reports a type error in this program. Click the line with the mistake.

const position: [number, number] = [3, 5];
const potions: [string, number] = [2, "Healing Potion"];
console.log(`${potions[0]} x${potions[1]} at ${position[0]}, ${position[1]}`);

Start programming for free

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with:

8/11