Interface JSObjectFunctions

    • Method Detail

      • toString

        java.lang.String toString()
        function toString() define an objects string representation.
        Overrides:
        toString in class java.lang.Object
        Since:
        Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
        See Also:
        Object, toLocalString(), valueOf()
      • toLocaleString

        JSString toLocaleString()
        function toLocaleString() return an object localized string representation.
        Since:
        Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
        See Also:
        Object, toString()
      • valueOf

        JSObject valueOf()
        function valueOf() the primitive value of a specified object.
        Since:
        Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
        See Also:
        Object., toString()
      • hasOwnProperty

        JSBoolean hasOwnProperty​(java.lang.String name)
        function hasOwnProperty(name) check whether a property is inherited.

        Example

         var o = new Object();
         o.x = 3.14;
         o.hasOwnProperty("x"); //return true; o has property x.
         o.hasOwnProperty("y"); //return false; o does not have property y.
         o.hasOwnProperty("toString"); //return false; o inherits toString.
         
        Parameters:
        name - A string that contains the name of a property of object.
        Since:
        Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
        See Also:
        Object, propertyIsEnumerable()
      • isPrototypeOf

        JSBoolean isPrototypeOf​(JSObject o)
        function isPrototypeOf(o) is an object the prototype of another?

        Example

         var o = new Object();
         Object.prototype.isPrototypeOf(o); //true: o is an object.
         Function.prototype.isPrototypeOf(o.toString(); //return true: toString is a function.
         Array.prototype.isPrototypeOf([1,2,3]; //return true: [1,2,3] is an Array.
         
        Parameters:
        o - Any object
        Since:
        Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
        See Also:
        Object
      • propertyIsEnumerable

        JSBoolean propertyIsEnumerable​(JSObject name)
        function propertyIsEnumerable(name) will property be seen by for/in loop?

        Example

         var o = new Object();
         o.x = 3.14;
         o.propertyIsEnumerable("x"); //return true; property x is local and enumerable.
         o.propertyIsEnumerable("y"); //return false; o does not have property y.
         o.propertyIsEnumerable("toString"); //return false; o inherits toString.
         
        Parameters:
        name - A string that contains the name of a property of object.
        Since:
        Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
        See Also:
        Object, hasOwnProperty(String)