MCPcopy Create free account
hub / github.com/buke/quickjs-go / Delete

Method Delete

value.go:572–579  ·  view source on GitHub ↗

Delete deletes the property with the given name.

(name string)

Source from the content-addressed store, hash-verified

570
571// Delete deletes the property with the given name.
572func (v *Value) Delete(name string) bool {
573 if !v.Has(name) {
574 return false // Property does not exist, nothing to delete
575 }
576 prop := v.ctx.NewAtom(name)
577 defer prop.Free()
578 return C.JS_DeleteProperty(v.ctx.ref, v.ref, prop.ref, C.int(1)) == 1
579}
580
581// DeleteIdx deletes the property with the given index.
582func (v *Value) DeleteIdx(idx uint32) bool {

Calls 3

HasMethod · 0.95
FreeMethod · 0.95
NewAtomMethod · 0.80