Functions

1. Arrays

  • chunk

    : Chunks an array into smaller arrays of a specified size.

  • compact

    : Removes falsy values from an array, If strict is true, also removes empty objects and arrays.

  • insert

    : Inserts elements into an array at a specified index.

  • sampleArr

    : Generates an array of random numbers.

  • search

    : Search objects in an array based on provided keys and query string. It only works with string and number values.

  • shuffleArr

    : Shuffles the elements of an array.

  • unique

    : Creates a unique array from the input array.

2. Functional

  • retry

    : Retries the given function a specified number of times with a delay between each retry.

  • sleep

    : Sleeps the execution for the specified number of milliseconds.

  • timeout

    : The timeout function wraps a function with a timeout. If the function does not complete within the specified time, the promise will be rejected.

3. Gates

  • and

    : Performs a logical AND operation on the given arguments.

  • nand

    : Performs a logical NAND operation on the given arguments.

  • nor

    : Performs a logical NOR operation on the given arguments.

  • or

    : Performs a logical OR operation on the given arguments.

4. Objects

  • mapObj

    : Same as Array.prototype.map, but for objects.