JSObjectUnsafeUtilExtension extension

Utility methods to check, get, set, and call properties on a JSObject.

See the JavaScript specification for more details on using properties.

on

Methods

callMethod<R extends JSAny?>(JSAny method, [JSAny? arg1, JSAny? arg2, JSAny? arg3, JSAny? arg4]) → R
Calls method on this JSObject with up to four arguments.
callMethodVarArgs<R extends JSAny?>(JSAny method, [List<JSAny?>? arguments]) → R
Calls method on this JSObject with a variable number of arguments.
delete(JSAny property) JSBoolean
Deletes the property with key property from this JSObject.
getProperty<R extends JSAny?>(JSAny property) → R
The value of the property key property of this JSObject.
has(String property) bool
Shorthand helper for hasProperty to check whether this JSObject contains the property key property, but takes and returns a Dart value.
hasProperty(JSAny property) JSBoolean
Whether or not this JSObject contains the property key property.
setProperty(JSAny property, JSAny? value) → void
Write the value of property key property of this JSObject.

Operators

operator [](String property) JSAny?
Shorthand helper for getProperty to get the value of the property key property of this JSObject, but takes and returns a Dart value.
operator []=(String property, JSAny? value) → void
Shorthand helper for setProperty to write the value of the property key property of this JSObject, but takes a Dart value.