//创建
var data={ key1:"value1",key2:"value2"};
//取值
var dataValue = data["key1"]
//或 var dataValue = data.key1,当key 为数值时该取值法不可用
//例:
var data ={ 111:"111",222:"222"}
var dataValue = data["111"]//正确
var dataValue = data.111 //错误
//添加
data["key3"] = "value3"; //添加时无该key值则添加,有则修改value
data.key4 = "value4";
//修改
data["key1"] = "value0";
data.key4 = "value0";
//存在则删除
if (!!data["key2"]) {
delete (data["key2"]);
}
//!!把一个任意类型的值转换为布尔类型,存在为true,不存在为false