How to reassemble arrays using double for loops

1 reassemble two arrays using double loops

2 condition
/ / 1. Compare the two arrays of Arr1,Arr2 and return a new array resultArr
/ / 2. ResultArr contains all the items in Arr2
/ / 3. If the project id in resultArr exists
/ / in Arr1 and its level is greater than level
/ / in resultArr project, its active familiar value is true, otherwise it is false

.
const myStacks = [{
  id: 1,
  name: "JavaScript",
  level: 2,
},{
  id: 2,
  name: "CSS",
  level: 1,
},{
  id: 4,
  name: "JQuery",
  level: 1,
}]

const jobStacks = [{
  id: 1,
  name: "JavaScript",
  level: 1,
},{
  id: 2,
  name: "CSS",
  level: 3,
},{
  id: 3,
  name: "HTML",
  level: 2,
}]

3. The result returns

// 
[{
   id: 1,
   name: "JavaScript",
   level: 1,
   active: true
 },{
  id: 2,
  name: "CSS",
  level: 3,
  active: false
},{
  id: 3,
  name: "HTML",
  level: 2,
  active: false
}]

var resultArr = jobStacks;
            resultArr.forEach(function(i){
                myStacks.forEach(function(j){
                    i.active = (i.id==j.id&&i.level<j.level) ?   true : false;
                 })
            })
            console.log(resultArr)

var arr=jobStacks
for(var i=0;i<arr.length;iPP){
    arr[i]['active']=false
}
for(var i=0;i<arr.length;iPP){
    for(var j=0;j<myStacks.length;jPP){
        if(arr[i].id===myStacks[j].id){
            if(arr[i].level<myStacks[j].level){
                arr[i]['active']=true
            }else{
                arr[i]['active']=false
            } 
        }
    }
}
console.log(arr)
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36b60-2ad7d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36b60-2ad7d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?