The object spread { ...o } copies only enumerable own properties, mirroring Object.keys behavior. x was defined as non-enumerable so it is omitted, while the enumerable y is copied, yielding {"y":2} after serialization. The enumerable descriptor flag thus directly controls what spread and JSON.stringify include.