锁定老帖子 主题:考考你们的JS 我只作对了一半 你们试试
精华帖 (0) :: 良好帖 (11) :: 新手帖 (0) :: 隐藏帖 (15)
|
|
---|---|
作者 | 正文 |
发表时间:2011-05-19
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT=""> </HEAD> <BODY> </BODY> </HTML> <!--[if ie]> <script> var console = {}; console.log = function(text){ document.body.innerHTML += text+"<br/>"; } </script> <![endif]--> <script> console.log("typeof(NaN): "+typeof(NaN)); console.log("typeof(Infinity): "+typeof(Infinity)); console.log("typeof(null): "+typeof(null)); console.log("typeof(undefined): "+typeof(undefined)); console.log("(NaN==NaN): "+(NaN==NaN)); console.log("(NaN!=NaN): "+(NaN!=NaN)); console.log("(NaN>NaN): "+(NaN>NaN)); console.log("(null==undefined): "+(null==undefined)); console.log("(null>=undefined): "+(null>=undefined)); console.log("(null<=undefined): "+(null<=undefined)); console.log("null==null: "+(null==null)); console.log("(null!=null): "+(null!=null)); console.log("(null!=NaN): "+(null!=NaN)); console.log("(null==NaN): "+(null==NaN)); console.log("(NaN==undefined): "+(NaN==undefined)); console.log("(parseInt(\"123abc\")): "+(parseInt("123abc"))); console.log("(\"123abc\"-0): "+("123abc"-0)); console.log("Infinity>10: "+(Infinity>10)); console.log("Infinity>\"abc\": "+(Infinity>"abc")); console.log("(Infinity==NaN): "+(Infinity==NaN)); console.log("(true==1): "+(true==1)); console.log("(new String(\"abc\")==\"abc\"): "+(new String("abc")=="abc")); console.log("new String(\"abc\")===\"abc\": "+(new String("abc")==="abc")); function step(a){ return function(x){ return x+a++; } } var a = step(10); var b = step(20); console.log(" function step(a){ "); console.log(" return function(x){ "); console.log(" return x+a++; "); console.log(" } "); console.log(" } "); console.log("var a = step(10); "); console.log("var b = step(20);"); console.log("a(10): "+a(10)); console.log("b(20): "+b(20)); var a="123abc"; console.log("var a=\"123abc\";"); console.log("typeof(a++): "+typeof(a++)); console.log("a: "+a); </script> |
|
返回顶楼 | |
发表时间:2011-06-02
这么全啊,以后肯定用得上
|
|
返回顶楼 | |