当前位置:首页 >> 网络编程

Javascript !!的作用

var wintype = !!os[1];

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