我有JS对象,在Chrome的控制台中看起来很容易:
data: Object
comparisonType: "IN"
dateValue: ""
numericalValue: 0
screeningCriterionId: "-4"
screeningField.displayName: "Prop1"
screeningField.fieldName: "Prop2"
screeningField.groupName: "Prop3"
screeningField.type: "MULTI"
value: null
我需要从这个对象中读取screeningField.displayName: "Prop1"
,但是
试图在控制台中执行此myObject.screeningField.displayName
我收到错误:
TypeError:无法读取未定义
的属性'displayName'
如何解决我的问题?
答案 0 :(得分:5)
显然,点实际上包含在键名中,请尝试:
myObject['screeningField.displayName']