Javascript !!的作用

(编辑:jimmy 日期: 2024/10/9 浏览:2)

var wintype = !!os[1];

取变量的Boolean值,
应该相当于 var wintype = os[1]?true:false,
但显然简洁很多。