当前位置: 代码迷 >> JavaScript >> 测试您的javascript
  详细解决方案

测试您的javascript

热度:136   发布时间:2012-11-07 09:56:10.0
测试你的javascript

<html>
?<script type="text/javascript">
/**
var n1 = 1.7976931348623157E+309;
alert(n1);? //Infinity
?
alert(typeof(NaN)); //?? number
?
alert(typeof(Infinity));?? //number?
?
alert(typeof(null));??? //object
?
alert(typeof(undefined));??? //undefined
?
alert(NaN==NaN);??? //false
?
alert(NaN!=NaN);??? //true
?
alert(NaN>NaN);???? //false
?
alert(null==undefined);?? //true
?
alert(null>=undefined);???? //false
?
alert(null<=undefined);???? //false
?
alert(null==null);?? //true
?
alert(null!=null);??? //false
?
alert(null!=NaN);??? //true
?
alert(null==NaN);?? //false
?
alert(NaN==undefined);? //false?
?
alert(parseInt("123abc"));?? //123
?
alert("123abc"-0);??? //NaN
?
alert(Infinity>10);? //true?
?
alert(Infinity>"abc");??? //false
?
alert(Infinity==NaN);?? //false
?
alert(true==1);??? //true
?
alert(new String("abc")=="abc");?? //true??
?
alert(new String("abc")==="abc");??? //false
?
???
function step(a){??
?
?? return function(x){??
?
????? return x+a++;??
?
?? }??
?
}??
?
var a = step(10);??
?
var b = step(20);??
?
alert(a(10));??
?
alert(b(20));??
?
var a="123abc";??
?
alert(typeof(a++));??
?
alert(a);? */

?</script>
</html>

  相关解决方案