item in array wont increment : If there is a duplicate in an array, I want to increment the value. These are my console log results:

this is the map { '1': 1, '2': 1, '3': 1, '4': 2 }
this is the values more than one 4
this is iitem before 4
this is item after 5
this is iitem before 4
this is item after 5
this is the array here [ 1, 4, 2, 3, 4 ]
[ 1, 4, 2, 3, 4 ]



    const incrementDuplicate = function(value, arr){
      for(let item of arr){
        if(item.toString() === value.toString()){
          console.log('this is iitem before', item);
          item = item+1;
          console.log('this is item after', item)
        }
      }
      return arr;
    }
    
    
    const uniqueArraySum = function(arr){
      let map = {};
      let newArray = [];
      for(let item of arr){
        if(!map[item]){
          map[item] = 1;
        } else{
          map[item]++;
        }
      }
      console.log('this is the map', map);
    
      for(let item in map){
        if(map[item] !== 1){
          console.log('this is the values more than one', item);
          newArray = incrementDuplicate(item, arr);
          console.log('this is the array here', arr);
        }
      }
      return newArray;
    }


console.log(uniqueArraySum([1,4,2,3,4]));