<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title>
</head><body></body>
<script>let d1 = ''let d2 = 0let d3 = NaNlet d4 = nulllet d5 = undefinedlet d6 = falselet d7 = 'hello world'let d8 = 100let d9 = truelet d10 = {}let d11 = {name: 'tom',}let d12 = []let d13 = [1, 2, 3]console.log('空字符串: ', Boolean(d1)) // 空字符串: falseconsole.log('数字 0: ', Boolean(d2)) // 数字 0: falseconsole.log('NaN: ', Boolean(d3)) // NaN: falseconsole.log('null: ', Boolean(d4)) // null: falseconsole.log('undefined: ', Boolean(d5)) // undefined: falseconsole.log('false: ', Boolean(d6)) // false: falseconsole.log('字符串 hello world: ', Boolean(d7)) // 字符串 hello world: trueconsole.log('数字 100: ', Boolean(d8)) // 数字 100: trueconsole.log('true: ', Boolean(d9)) // true: trueconsole.log('{}: ', Boolean(d10)) // {}: trueconsole.log('{name: tom}: ', Boolean(d11)) // {name: tom, age: 18, gender: male}: trueconsole.log('[]: ', Boolean(d12)) // []: trueconsole.log('[1, 2, 3]: ', Boolean(d13)) // [1, 2, 3]: true
</script></html>
