SOURCE

console 命令行工具 X clear

                    
>
console
// 接口返回code类型判断 均使用 +code === 200, +code 为number类型
let code = '200'
if (+code === 200) {
	console.log(+code + '为number类型')
}

// 对象属性的严格判断,先判断存在,在严格判断类型或者强转类型,操作属性方法
let options = {
	scene: '1000234'
}
if (!!options && options.scene && String(options.scene).length > 4) {
	console.log(String(options.scene))
}

// 

<h4>类型判断思考</h4>
<ol>
	<li>有哪些类型</li>
	<li>常用的场景</li>
	<li>常用判断方法</li>
	<li>常用第三方库方法</li>
</ol>

1、类型:<br>
基本类型:string、number、bol、undefined、null、NaN   <br>
引用类型:array、object、function、
<br>
2、场景:<br>
   * 

<div class="box1">
	<div class="box2"> 
		llalalalal llalalla 
	</div>
</div>
/* .box1{
	border: 1px solid #eee;
	width: 300px;
	height: 300px;
	position: relative;
	background: red;
}
.box2{
	background:yellow;
	position:absolute;
	top:0;
	left:0;
	right:0;
	bottom:0;
	width: 50px;
	height: 50px;
	margin: auto;
} */

.box1{
	display: flex;
	align-items:center;
	justify-content:center;
	width: 300px;
	height: 300px;
	background: red;
}
.box2{
	border: 3px solid #458761;
  padding: 20px;
}