Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
var a;
if(a) {
  console.log('Hello World!')
}
//不输出
if(true) {
  console.log('Hello World!')
}
//输出结果:Hello World!
if(false) {
  console.log('Hello World!')
}
//不输出
if(0) {
  console.log('Hello World!')
}
//不输出
if(+0) {
  console.log('Hello World!')
}
//不输出
if(123) {
  console.log('Hello World!')
}
//输出结果:Hello World!
if(NaN) {
  console.log('Hello World!')
}
//不输出
if('') {
  console.log('Hello World!')
}
//不输出
if(' ') {
  console.log('Hello World!')
}
//输出结果:Hello World!
if('123') {
  console.log('Hello World!')
}
//输出结果:Hello World!
if('abc') {
  console.log('Hello World!')
}
//输出结果:Hello World!
if([0]) {
  console.log('Hello World!')
}
//输出结果:Hello World!
if([0, 1, 2]) {
  console.log('Hello World!')
}
//输出结果:Hello World!
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
novuepro
0viewers