All Articles

Check If String Contains Another String

This function checks if a given string contains another string. It uses PHP’s strpos function which returns the position of…

Check If String Ends With Another String

This function checks if a given string ends with another string. It uses substr to get the ending part of…

Check if an array is empty

This function checks whether an array is empty. JavaScript: TypeScript:

Compare two sets

This function compares two sets for equality, regardless of the order of elements. JavaScript: TypeScript:

Create a set from an array

This function creates a set from an array. The set contains all unique elements of the array. JavaScript: TypeScript:

Check if a set is a subset of another set

This function checks whether the first set is a subset of the second set. JavaScript: TypeScript:

Remove an item from a set

This function removes an item from a set. JavaScript: TypeScript:

Clone an array

This function clones an array, creating a new array with the same elements. JavaScript: TypeScript:

Find the maximum item of a set

This function returns the maximum value from a set. JavaScript: TypeScript:

Find the minimum item of a set

This function returns the minimum value from a set. JavaScript: TypeScript: