js基础练习一

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script type="text/javascript">
// var a="box";
// alert(typeof a)
//
//
// var box;
// alert(box)
//
// var dd=null;
// alert(typeof dd);
//
// if(dd!=null){
// alert("对象存在")
// }
// alert(undefined==null)
//// var box1;
//// vard=null; //这个是错误的
//// alert(typeof==typeof d)
//

//boolean

// var box=true;
// alert(typeof box);
// var hell0="dksdkk";
// var heel=Boolean(hell0); //强制转换、、非空全部都是ture;
// alert(typeof heel);
// if(hell0){
// alert("如果为ture,就执行我这条")
// }else{
// alert("false.就执行我")
// }
// alert(parseInt("122FKDFDF")) //取证
// alert(parseInt("2.23455"))
// alert(parseFloat("2.23455")) //会取小数点
//
// var box="mr";
// box=box+"leas";
// alert(typeof box.toString())
// var ss=10;
// alert(ss.toString(10));
// var boxs=new Object(1);
// var age=boxs+1;
// alert(age);
//运算
// var box=100;
//// var age=++box; //先运算在赋值了。
//// console.log(age) ;
// var bos=box++; //先赋值在运算了。
// alert(bos);
//
// var box=3>2;
// console.log(box);
//
//
// var box=100; //把右边的赋值给左边,
// box=box+200; //自身本身+200 进行赋值运算;
// console.log(box);
// box+=100; //200 +=代替box+100;
//
//


</script>
</body>
</html>

猜你喜欢

转载自www.cnblogs.com/fengyuzhen34/p/9008597.html