derefbeginnerconst ref = new WeakRef({})
const obj = ref.deref()
if (obj) { /* safe to use */ }Check the result of deref() before using it to avoid null-reference errors.
typeof new WeakRef({}).deref() is 'object'.
Challenge: Verify the type of the deref result.