js中读取对象属性的方式有两种
1、点方式
2、中括号方式
如果属性带有特殊符号,只能使用中括号方式读取。例如:
var test = {
'method':'get',
'axios-retry':{
lastRequestTime: 1639636666949,
retryCount: 0,
}
}
console.log(test.method)
console.log(test['method'])
console.log(test['axios-retry']) // axios-retry只能使用中括号方式读取