Object.clear

Object.clear

Object.clear

Function

Clear the object and return the original object.

Syntax

Parameters

No parameters.

Return value

TypeDescription
ObjectReturns the original object.

Return object fields

clear() returns the same object reference that it was called on. All fields in the object will be deleted after the call, so the returned object is an empty Object.

Example

Notes

  • clear will modify the original object.
  • clear will reuse the object container, which is suitable for scenarios where writing continues after clearing in the resident process.