.insert(location,val)

Description

insert adds a new property to the object or overwrites an existing one.

Parameters

  • key — property name to insert.

  • val — value to assign.

Usage On Objects

obj = {a:1}
obj.insert("b",2)
log obj // {a:1,b:2}

Last updated

Was this helpful?