TypeScript · Junior · Question 61 of 75
What type does const items = []; get with strict enabled?
- ✓Correct answer: An "evolving"
any[]whose type is determined by what you push into it; annotating it (const items: Item[] = []) is clearer - 2
never[]always - 3
unknown[]
Explanation
Explicit annotation documents intent and prevents surprises when the array is returned or passed elsewhere.