var variable = 67;
var map =
{
key 1 : 'string_val',
key 2 : variable,
'key 3': function(){alert('blah')},
'if the key is not a valid variable name, or is reserved, quote it': true
}
alert(map.key 1);
alert(map['key 2']);
map.key 3();
if( map['if the key is not a valid variable name, or is reserved, quote it'])
alert('OK?');
最后
以上就是追寻小笼包最近收集整理的关于(转)javascript 如何实现键值对的全部内容,更多相关(转)javascript内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复