JSValue value = Undefined(); if (value.isUndefined()) { cout << "The variable is undefined"; } else { cout << "The variable is not undefined"; }
JSObject object; JSValue property = object.getProperty("myProperty"); if (property.isUndefined()) { cout << "The property is undefined"; } else { cout << "The property is not undefined"; }This example gets a property from a JSObject, then checks whether the property is undefined using the isUndefined method. Package library: JavaScriptCore