The Global object has properties and methods at the highest level, without a parent object. This means the global properties and functions can be used with all the built-in JavaScript objects.
var xn = 1.8976543348623157E+12088; document.write(xn); // Infinity
var minutes = 61; if(minutes<0 || minutes>60) { minutes = Number.NaN; } document.write(minutes); // NaN
var xv; if(xv==undefined) { document.write('xv is undefined'); }
var str = 'ab @# 78'; document.write(escape(str)); // ab%20@%23%2078
let str ="document.write('coursesweb.net');"; eval(str); // coursesweb.net
document.write(isFinite(123) +'<br>'); // true document.write(isFinite('string')); // false
document.write(isNaN(123) +'<br>'); // false document.write(isNaN('string')); // true
var dat = new Date(); document.write(Number(dat) +'<br>'); // 1296464847762 document.write(Number('0078')); // 78
document.write(parseFloat('12.8 pm')); // 12.8
document.write(parseInt('12.8 pm')); // 12
var dat = new Date(); document.write(String(dat)); // Mon Jan 31 2011 11:13:47 GMT+0200 (GTB Standard Time)
var str = 'ab%20@%23%2078'; document.write(unescape(str)); // ab @# 78
<ul> <li>http://coursesweb.net/html/</li> <li>http://coursesweb.net/css/</li> </ul>
.some_class { display: list-item; }
var obj = { "courses": ["php", "javascript", "ajax"] }; var jsonstr = JSON.stringify(obj); alert(jsonstr); // {"courses":["php","javascript","ajax"]}
$strhtml = '<body><div id="dv1">CoursesWeb.net</div></body>'; $dochtml = new DOMDocument(); $dochtml->loadHTML($strhtml); $elm = $dochtml->getElementById("dv1"); echo $elm->nodeValue; // CoursesWeb.net