【发布时间】:2018-12-17 17:22:31
【问题描述】:
我有一个数组,如果使用 typescript 的对象“higherOptions”中有值,我想在其中比较对象“defaultvalue”和“selectedvalue”。
let coverageArray = [
{
"id":1,
"defaultValue": 100000,
"selectedValue": 100000,
"higherOptions": []
},
{
"id":2,
"defaultValue": 300000,
"selectedValue": 300000,
"higherOptions": [150000, 300000]
},
{
"id":3,
"defaultValue": 500,
"selectedValue": 500,
"higherOptions": [500, 1000]
},
{
"id":4,
"defaultValue": "ALS (12 months of restroration)",
"selectedValue": "ALS (12 months of restroration)",
"higherOptions": []
},
{
"id":5,
"defaultValue": 15000,
"selectedValue": 15000,
"higherOptions": [ 15000, 20000, 25000, 30000, 35000 ]
}];
【问题讨论】:
标签: arrays json angular typescript