码迷,mamicode.com
首页 > Web开发 > 详细

js 判断json 是否存在某个key

时间:2019-01-30 16:08:26      阅读:219      评论:0      收藏:0      [点我收藏+]

标签:int   code   obj   and   nbsp   class   mat   json   OLE   

 1 // var num=parseInt(Math.random()*10) 
 2 // console.log(num)
 3 // console.log(2+9+"")
 4 // console.log(typeof(2+9+""))
 5 
 6 // console.log(2+""+9)
 7 // console.log(""+2+9)
 8 
 9 
10 
11 var obj={
12     "name":"Jack",
13     "age":24,
14     "gender":"male"
15 }
16 
17 // console.log("weqweqwe" in obj)
18 console.log(obj.hasOwnProperty("name"))

 

js 判断json 是否存在某个key

标签:int   code   obj   and   nbsp   class   mat   json   OLE   

原文地址:https://www.cnblogs.com/Mengchangxin/p/10337625.html

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