Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumTypeScriptrecursive typesSingle-choice MCQ

Using mutually recursive declarations to model JSON, what is true about this code?

type JSONValue = string | number | boolean | null | JSONObject | JSONArray; interface JSONObject { [k: string]: JSONValue } interface JSONArray extends Array<JSONValue> {} const v: JSONValue = { a: [1, { b: null }] };