DeepFrontend
Learning Paths
Practice
System Design & DS
Design Studio
Data Structures Curriculum
Real-World Case Studies
Careers
Job Board
Resume Builder
Blog
Sign in
Search
⌘K
Go Pro
Loading compiler resources...
TypeScript Quiz Practice
Active Recall Drill Session
← Exit Session
Question 1 of 1
medium
TypeScript
A function parameter is typed as number[] but the function actually requires EXACTLY two numbers to work correctly. What's the risk of using number[] here instead of a tuple?
A
There is no risk, they're equivalent
B
number[] accepts arrays of ANY length, silently allowing callers to pass too few or too many elements, unlike [number, number] which enforces exactly two
C
number[] is slower at runtime
D
Tuples cannot contain numbers
Check Answer