Need help on Diff Two Arrays

https://www.freecodecamp.org/challenges/diff-two-arrays.

Can I get help in following code or link is above. I am getting err messgaes as seen but do not understand how to solve them. I alos do not know if it works.

function diffArray(arr1, arr2) {
  var newArr = arr1.concat(arr2).sort(); //join arr1 and arr2 then sort.
 
  var myArr = [];
  
  for(var i = 0; i < newArr.length; i++){
    var x = newArr[i]; 

//value at index i.
  //on following code my errors are 'bad assignment" and "expected a conditional expressions and instead saw an assignment" which I can not understand.  
   
 if(newArr.lastIndexOf(x) = i){ 

 //in the same newArr find out last reoccurance of value at i, if it is same then 'push' in myArr.

      myArr.push(x);
      
    } //if..lastIndexOf is closing here

    return myArr;

  }//for loop is clsing here
  
}//function
diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);

Thanks. I corrected that. Now I do not syntex error. But my logic is not giving right answer. Can I get help please.