Tuesday, 3 March 2020

JavaScript function to remove duplicates in single dimension array

function removeDuplicatesInSingleDimensionArray(array) {
  return array.filter((a, b) => array.indexOf(a) === b)
};

No comments:

Post a Comment