built-in object definitions : Objects that have ECMAScript implementations that do not depend on the hosting environment, and objects that have been created before ECMAScript run are called built-in objects.
That is, it is not necessary for our developers to instantiate objects to be able to invoke and run objects. Only two built-in object global and math objects are defined in ECM-262
First, global objects
The global (Global) object is a special object in ECMAScript because the object does not exist. Any methods and properties in ECMAScript that are not part of other objects are methods and properties of this object.
1. Encoding/decoding method of global object
Window.onload=function(){ varUrl= "Http://www.baidu.com"; //Code encode //the method does not encode ASCII letters and numbers, nor does it encode these ASCII punctuation marks:-_.! ~ * ' (). varEncode=encodeuri (URL);//http://www.baidu.com //fully encoded, which encodes all non-standard characters found in the URI varEncodecomponent=encodeuricomponent (URL);//http%3a%2f%2fwww.baidu.com //decoding //decodeURI (): Used to decode the URI encoded by the encoding Method encodeURI () varDecode=decodeuri (encode);//http://www.baidu.com //decodeuricomponent (): Used to decode the URI encoded by the encoding Method encodeURIComponent () varDecodecomponent=decodeuricomponent (encodecomponent);//http://www.baidu.com }
Eval () method for 2.Global objects
JS Built-in objects