测试结果:
<script type="text/javascript">
" + (object == undefined ? 'true' : 'false') + '
');
document.writeln("object === undefined -> " + (object === undefined ? 'true' : 'false') + '
');
document.writeln("object == 'undefined' -> " + (object == 'undefined' ? 'true' : 'false') + '
');
document.writeln("object == null -> " + (object == null ? 'true' : 'false') + '
');
document.writeln("object === null -> " + (object === null ? 'true' : 'false') + '
');
document.writeln("object == 'null' -> " + (object == 'null' ? 'true' : 'false') + '
');
}
// --></script>