我有两个数组。我想只比较两个数组中的数量。 在第二个数组中,我想从第一个数组中替换不匹配的值。 像50 Qty不在第二个数组中所以我想从第一个数组
替换它 SELECT DECODE(column_name,
'false', '0',
'no', '0',
'true', '1',
'yes', '1'
)::integer::boolean from table_name;
` 该怎么做请告诉我?
答案 0 :(得分:0)
仍然不完全确定你想要做什么,但这是我如何构建它:
function onUserCancel() {
if (Array2[i] !== Array1[i]) { // where i is the index of the changed element
Array2[i] = Array1[i];
}
}
答案 1 :(得分:0)
function compare(arr1, arr2) {
for (let i = 0; i < arr2.length; i++) {
if (arr1[i].Qty !== arr2[i].Qty) {
arr2[i].Qty = arr1[i].Qty
}
}
}