[{
"currentPos": 2,
"isSelected": false,
"text": 4
},
{
"currentPos": 1,
"isSelected": true,
"text": 3
},
{
"currentPos": 3,
"isSelected": true,
"text": 1
}
]
var a = [{
"currentPos": 2,
"isSelected": true,
"text": 4
},
{
"currentPos": 1,
"isSelected": true,
"text": 3
},
{
"currentPos": 3,
"isSelected": true,
"text": 1
}
]
var b = a.every(function(item) {
return item.isSelected
})
console.log(b)
$arr = '[{
"currentPos": 2,
"isSelected": false,
"text": 4
},
{
"currentPos": 1,
"isSelected": true,
"text": 3
},
{
"currentPos": 3,
"isSelected": true,
"text": 1
}
]';
$arr = json_decode($arr);
$result = true;
foreach ($arr as $val) {
if (!$val["isSelected"]) {
$result = false;
break;
}
}