Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardJavaScriptToPrimitive coercion algorithmSingle-choice MCQ

An object defines Symbol.toPrimitive to simply return the hint string it receives. Across these four operations, which one passes the 'default' hint?

const obj = { [Symbol.toPrimitive](hint) { return hint; } }; // A: `${obj}` // B: obj + '' // C: +obj // D: obj * 2