# Basic libraries

# console

The console.logmethod is used to output information in the console window.It can accept multiple parameters and connect their results to output.

# Math

# attribute

  • E
  • LN10
  • LN2
  • LOG2E
  • LOG10E
  • PI
  • SQRT1_2
  • SQRT2

The specific use of the above attributes refer toES5standard.

# method

  • abs
  • acos
  • asin
  • atan
  • atan2
  • ceil
  • cos
  • exp
  • floor
  • log
  • max
  • min
  • pow
  • random
  • round
  • sin
  • sqrt
  • tan

The specific use of the above methods refer toES5standard.

# JSON

# method

  • String ify: ConvertsobjecttoJSONcharacter string.
  • Parse (string): Converts theJSONcharacter string to an object.

Example code:


console.log(undefined === JSON.stringify());
console.log(undefined === JSON.stringify(undefined));
console.log("null"===JSON.stringify(null));

console.log("111"===JSON.stringify(111));
console.log('"111"'===JSON.stringify("111"));
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(111===JSON.parse(JSON.stringify(111)));
console.log("111"===JSON.parse(JSON.stringify("111")));
console.log(true===JSON.parse(JSON.stringify(true)));

console.log(undefined===JSON.parse(JSON.stringify(function(){})));

# Number

# attribute

  • MAX_VALUE
  • MIN_VALUE
  • NEGATIVE_INFINITY
  • POSITIVE_INFINITY

The specific use of the above attributes refer toES5standard.

# Date

# attribute

  • parse
  • UTC
  • now

The specific use of the above attributes refer toES5standard.

# Global

# attribute

  • NaN
  • Infinity
  • undefined

The specific use of the above attributes refer toES5standard.

# method

  • parseInt
  • parseFloat
  • isNaN
  • isFinite
  • decodeURI
  • decodeURIComponent
  • encodeURI
  • encodeURIComponent

The specific use of the above methods refer toES5standard.