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 SummaryDescription
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 Fields

Parameters:

  • val - The value to test.

Output Fields

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

*** Script: false