Global
Note: SJS does not support most of the global attributes and methods of JavaScript.
Attribute
- Infinity
- NaN
- undefined
Note: For information about how to use these global attributes, see the ES5 specification.
Method
- decodeURI
- decodeURIComponent
- encodeURI
- encodeURIComponent
- isNaN
- isFinite
- parseFloat
- parseInt
Note: For information about how to use these global attributes, see the ES5 specification.
console
The console.log
method is used to output relevant information in the console. This method can accept multiple parameters and connect the parameter results in the output.
Date
Method
- now
- parse
- UTC
Note: For information about how to use these global attributes, see the ES5 specification.
Number
Attribute
- MAX_VALUE
- MIN_VALUE
- NEGATIVE_INFINITY
- POSITIVE_INFINITY
Note: For information about how to use these global attributes, see the ES5 specification.
JSON
Method
stringify(object)
: converts an object into a JSON string and returns the string.parse(string)
: converts a JSON string into an object and returns the object.
Example
console.log(undefined === JSON.stringify());
console.log(undefined === JSON.stringify(undefined));
console.log("null"===JSON.stringify(null));
console.log("222"===JSON.stringify(222));
console.log('"222"'===JSON.stringify("222"));
console.log("true"===JSON.stringify(true));
console.log(undefined===JSON.stringify(function(){}));
console.log(undefined===JSON.parse(JSON.stringify()));
console.log(undefined===JSON.parse(JSON.stringify(undefined)));
console.log(null===JSON.parse(JSON.stringify(null)));
console.log(222===JSON.parse(JSON.stringify(222)));
console.log("222"===JSON.parse(JSON.stringify("222")));
console.log(true===JSON.parse(JSON.stringify(true)));
console.log(undefined===JSON.parse(JSON.stringify(function(){})));
Math
Attribute
- E
- LN10
- LN2
- LOG2E
- LOG10E
- PI
- SQRT1_2
- SQRT2
Note: For information about how to use these global attributes, see the ES5 specification.
Method
- abs
- acos
- asin
- atan
- atan2
- ceil
- cos
- exp
- floor
- log
- max
- min
- pow
- random
- round
- sin
- sqrt
- tan
Note: For information about how to use these global attributes, see the ES5 specification.