码迷,mamicode.com
首页 > 编程语言 > 详细

JavaScript null and undefined

时间:2014-07-19 12:10:50      阅读:232      评论:0      收藏:0      [点我收藏+]

标签:http   java   io   re   javascript   c   

http://stackoverflow.com/questions/6429225/javascript-null-or-undefined

var x; x == null // true x == undefined // true x === null // false x === undefined // true var y = null; y == null // true y == undefined // true y === null // true y === undefined // false typeof x // ‘undefined‘ typeof y // ‘object‘ var z = {abc: null}; z.abc == null // true z.abc == undefined // true z.abc === null // true z.abc === undefined // false z.xyz == null // true z.xyz == undefined // true z.xyz === null // false z.xyz === undefined // true null = 1; // throws error: invalid left hand assignment undefined = 1; // works fine: this can cause some problems

JavaScript null and undefined,布布扣,bubuko.com

JavaScript null and undefined

标签:http   java   io   re   javascript   c   

原文地址:http://www.cnblogs.com/webglcn/p/3854712.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!