Edit in JSFiddle

let removeDuplicates = array => {
	let output = [];
  
	array.forEach(item => {
    if(!output.includes(item))
      output.push(item);
  });

  document.write(output);
};

removeDuplicates([1,2,3,2,4,4]);