本文主要是介绍比较相同的新旧两个数据对象-使用场景(判断保存是否有修改),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
let compare_result = [];let cpmpare_flag = false;/*对比判断新旧数组是否修过控制器(特别当只有一条控制器时,删除一条 添加一条) */if(that.controlerSelectParams.length >= that.controlerSelectParams_cun.length){that.controlerSelectParams.filter( (perItem) => {let perObj = perItem.controlCode;that.controlerSelectParams_cun.filter( (curItem) => {let curObj = curItem.controlCode;if(perObj == curObj){cpmpare_flag = true;return;}});if(!cpmpare_flag){compare_result.push(perObj);}});}else{that.controlerSelectParams_cun.filter( (curItem) => {let curObj = curItem.controlCode;that.controlerSelectParams.filter( (perItem) => {let perObj = perItem.controlCode;
这篇关于比较相同的新旧两个数据对象-使用场景(判断保存是否有修改)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!