javascript笔记

Object.freeze(对象名);禁止修改

“user strict”严格模式 

typeof parseInt();转换
.spilt("").length转换成数组
valueof()获取值
=== 绝对等于
 
//类型转换
let ab="0";
console.log( ab == false);

//let array=[];
console.log(Number(array));
console.log(array == false);
 
//显示转换Boolean类型
let ab=0;
ab=!!ab;
console.log(ab);
console.log(Boolean(ab));
 
//数字转换字符串
let ab=99;
let bx=ab.toString();
console.log(typeof bx);
 
//获取最大值
let grade=[55,66,44,556,22];
console.log(Math.max.apply(null,grade))
 
//取于
console.log((5.556).toFixed(2));
console.log(Math.round(5.599));
 
//旋转
 transform: rotate(270deg);

 

 
posted @ 2020-01-03 08:58  徐12  阅读(125)  评论(0编辑  收藏  举报