Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScriptvariance co contraSingle-choice MCQ

With explicit variance annotations, which assignment direction does the checker accept for the two generic interfaces below?

interface Getter<out T> { get(): T; } declare let gNum: Getter<number>; declare let gAny: Getter<number | string>;