Created
September 4, 2015 12:40
-
-
Save magnet88jp/6cfc0f467aff0514f650 to your computer and use it in GitHub Desktop.
javascipt (hoge != null && hoge.length > 0)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
</head> | |
<body> | |
<h1>test</h1> | |
<script> | |
var aaa = ''; | |
var bbb = '0'; | |
var ccc = '1'; | |
var ddd; | |
var eee = null; | |
var fff = ' '; | |
var ggg = 0; | |
var hhh = 1; | |
var test = !!(aaa) ? aaa : 'ng'; | |
console.log('aaa='+ test); | |
test = !!(bbb) ? bbb : 'ng'; | |
console.log('bbb='+ test); | |
test = !!(ccc) ? ccc : 'ng'; | |
console.log('ccc='+ test); | |
test = !!(ddd) ? ddd : 'ng'; | |
//test = (ddd != null && ddd.length > 0) ? ddd : 'ng'; | |
console.log('ddd='+ test); | |
test = !!(eee) ? eee : 'ng'; | |
console.log('eee='+ test); | |
test = !!(fff) ? fff : 'ng'; | |
console.log('fff='+ test); | |
//test = !!(ggg) ? ggg : 'ng'; | |
test = (ggg != null && ggg.length > 0) ? ddd : 'ng'; | |
console.log('ggg='+ test); | |
test = !!(hhh) ? hhh : 'ng'; | |
console.log('hhh='+ test); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment