Fork me on GitHub

Coding Poineer

Coding Poineer

Coding Poineer

Coding Poineer

Coding Poineer

Coding Poineer

Coding Poineer

Coding Poineer

Coding Poineer

Coding Poineer

Coding Poineer

算法辅助(js)

if/switchwhile决定判断条件时,可以参考

var s1 = {}
var s2 = undefined
var s3 = null
var s4 = ""
var s5 = []

if(s1) console.log('true')  // {} 被识别为true
if(s2) console.log('true')
if(s3) console.log('true')
if(s4) console.log('true')
if(s5) console.log('true')  // [] 被识别为true

posted @ 2020-11-09 12:57  365/24/60  阅读(81)  评论(0编辑  收藏  举报