IsJavaObject

Determines if a value is an instance of a Java object rather than a JavaScript primitive, JavaScript object, null, or undefined.

Where to use

Use in any JavaScript code if you need to test for a Java object instance.

Method summary

Method summary Description
isJavaObject(val) Determines if a given value is an instance of a Java object.

Method detail

isJavaObject(val)
Determines if a given value is an instance of a Java object.
  • Input field parameters: val: the value to test.
  • Output field returns (boolean):
    • True if the given value is an instance Java object.
    • False if the value is a JavaScript primitive, JavaScript object, null, or undefined.

Example:

var jsn = new JSON();
var jsary = [{ name: 'test', value: 1 }, { key: 'test2', value: 2}];
gs.print(isJavaObject(jsn));

Output returns: *** Script: false