美文网首页
2019-04-15 json集合

2019-04-15 json集合

作者: 果冻_4c9b | 来源:发表于2019-04-19 08:35 被阅读0次
  <!DOCTYPE html>
    <html>
<head>
    <meta charset="utf-8">
    <title></title>
</head>
<body>
    <script type="text/javascript">
        // json 类似map集合
        var json={
            'name':'张国栋',
            'age':'23'
        };
        console.log(json['name']);
        console.log(json['age']);
        // 遍历
        for(attr in json){
            console.log(attr,json[attr]);
        }
    </script>
  </body>
  </html>

相关文章

网友评论

      本文标题:2019-04-15 json集合

      本文链接:https://www.haomeiwen.com/subject/osvpwqtx.html