toString()

Method Description

Method used to determine an object’s type. This is a global method that is loaded by default for all native SuiteScript 2.x API objects.

Note:

Consider this method a replacement for the instanceOf operator (which is not supported). SuiteScript 2.x members are immutable; you cannot construct or modify a native SuiteScript 2.x member. Consequently, if you attempt to call instanceOf, an undefined error is thrown.

For information about toString() as a native JavaScript method, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_objects/object/toString.

Returns

The object type as a string

Supported Script Types

Client and server scripts

Governance

None

Since

2015.2

Syntax

The following code snippet shows the syntax for this member. It is not a functional example.

          ...
var type = mapContext.toString();     // When called on mapReduce.MapContext, toString returns "mapReduce.MapContext"
... 

        

Related Topics

General Notices