数据类型Boolean类型
来源:互联网 发布:示剑网络马大伟 编辑:程序博客网 时间:2024/06/06 03:45
数据类型Boolean类型:
var box="myDemo";//值显示真
if (box) {
alert('真');
// statement
} else {
alert('假');
// statement
}
var box="";//值显示假
if (box) {
alert('真');
// statement
} else {
alert('假');
// statement
}
var box=123;//值显示真
if (box) {
alert('真');
// statement
} else {
alert('假');
// statement
}
var box=-123;//值显示真
if (box) {
alert('真');
// statement
} else {
alert('假');
// statement
}
var box=0;//值显示假
if (box) {
alert('真');
// statement
} else {
alert('假');
// statement
}
var box=-NaN;//值显示假
if (box) {
alert('真');
// statement
} else {
alert('假');
// statement
}
var box={};//值显示真
if (box) {
alert('真');
// statement
} else {
alert('假');
// statement
}
var box=null;//值显示假
if (box) {
alert('真');
// statement
} else {
alert('假');
// statement
}
var box;//值显示假,因为数据类型为Undefined
if (box) {
alert('真');
// statement
} else {
alert('假');
// statement
}
var box="myDemo";//值显示真
if (box) {
alert('真');
// statement
} else {
alert('假');
// statement
}
var box="";//值显示假
if (box) {
alert('真');
// statement
} else {
alert('假');
// statement
}
var box=123;//值显示真
if (box) {
alert('真');
// statement
} else {
alert('假');
// statement
}
var box=-123;//值显示真
if (box) {
alert('真');
// statement
} else {
alert('假');
// statement
}
var box=0;//值显示假
if (box) {
alert('真');
// statement
} else {
alert('假');
// statement
}
var box=-NaN;//值显示假
if (box) {
alert('真');
// statement
} else {
alert('假');
// statement
}
var box={};//值显示真
if (box) {
alert('真');
// statement
} else {
alert('假');
// statement
}
var box=null;//值显示假
if (box) {
alert('真');
// statement
} else {
alert('假');
// statement
}
var box;//值显示假,因为数据类型为Undefined
if (box) {
alert('真');
// statement
} else {
alert('假');
// statement
}
0 0
- 数据类型Boolean类型
- 基本数据类型boolean的封装类型之Boolean源码分析
- Boolean数据类型
- Boolean数据类型.
- js中各数据类型转换到Boolean类型
- Boolean类型
- boolean类型
- Boolean类型
- js、变量、标识符、字面量、数据类型、Null类型、Undefined类型、String类型、Number类型、Boolean类型、数据类型的转换
- JavaScript第三课——数据类型(typeof操作符、Undefined类型、Null类型、Boolean类型)
- 第3章 基本概念(2)数据类型:typeof操作符 Undefined类型 Null类型 Boolean类型
- vb.net Boolean 数据类型
- 数据类型中boolean型
- java数据类型之boolean
- Java boolean数据类型
- Boolean数据类型转换
- String数据类型转换成long、int、double、float、boolean、char等七种数据类型
- Javascript的Boolean类型
- AJAX ASP/PHP 实例
- AJAX Database 实例
- AJAX XML 实例
- ThreadingTCPServer的简化代码实现
- python可视化-matplotlib学习
- 数据类型Boolean类型
- 条款三十一:让函数根据一个以上的对象类型来决定如何虚化
- ProtostuffUtil—快速序列化和反序列化对象工具
- 数据类型Number类型
- 2016年在美帝找实习总结
- 数据类型String类型
- Unity中关于Device Filter的选择问题
- Hibernate框架(一)文件配置、核心API、对象状态详解
- 数据类型Object类型