<pre>
<script>
let allData = [{
idStandard: 1278,
valueDecNew: 8
},
{
idStandard: 1279,
valueDecNew: 3
},
{
idStandard: 1280,
valueDecNew: 6
},
{
idStandard: 1284,
valueDecNew: 56
}
]
let params = [{
idStandard: 1278,
valueDecNew: 0
},
{
idStandard: 1279,
valueDecNew: 0
},
{
idStandard: 1282,
valueDecNew: 0
}
]
let arr = params.map(function(x) {
return x.idStandard
});
let allfilter = allData.filter(function(x) {
return arr.indexOf(x.idStandard) === -1
})
let result = params.concat(allfilter).sort(function(a, b) {
return a.idStandard - b.idStandard
})
document.write(JSON.stringify(result, "", 1))
</script> </pre>