var arr = {‘a‘:‘A‘,‘b‘:‘B‘}; console.log(arr); console.log(typeof arr); console.log(arr[‘a‘]); console.log(arr.a);
都可以正常输出
var arr = []; arr[‘a‘] = ‘A‘; arr[‘b‘] = ‘B‘; console.log(arr);
console.log(typefof arr); //object
console.log(arr.a); //A
console.log(arr[‘a‘]); //A
时间: 2024-11-10 20:44:04