Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScriptmethod bivariance strictFunctionTypesSingle-choice MCQ

Why is `animals = dogs` accepted, demonstrating that `Array<T>` behaves covariantly even under `strict`?

let dogs: Array<{ breed: string }>; let animals: Array<{}>; animals = dogs; // accepted under strict