<!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>
网友评论