goldies
    Preparing search index...

    Function dedupe

    • Remove duplicate items from an array. Creates a new array with duplicate items removed. Adapted from: (c) 2019 Chris Ferdinandi, MIT License https://gomakethings.com

      Type Parameters

      • T

      Parameters

      • array: T[]

        The input array.

      Returns T[]

      A new array with duplicates removed.

      // Remove duplicates from an array
      const uniqueArray = dedupe([1, 2, 2, 3, 4, 4, 5]);
      console.log(uniqueArray); // Output: [1, 2, 3, 4, 5]