A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-78.ts
1classPoint{constructor(publicx=1){}}
2constp=newPoint(5)
3constc=structuredClone(p)
4console.log(c.x,cinstanceofPoint)
Modern
Answer & explanation
Console output
5 false
Why
`structuredClone` performs a deep structured copy of the data fields but does NOT preserve the prototype chain, so the clone is a plain object rather than a class instance. The own property `x` is copied (5), yet `c instanceof Point` is `false`. TypeScript types the result as `Point`, which is misleading: the static type claims more than the runtime delivers.