It is just a wrapper around fetch function which throws errors and converts promise to data
This function takes in two city names and returns true or false by comparing the two cities using the following apporach:
convert both city names to lowercase and split the city name by space (ignore if city name starts with new)
Check if every item in both arrays are present and return the result.
* indicates required fields
Parameter | Default Value | Type | Description |
---|---|---|---|
str1* | [] | string | 1st city |
str2* | [] | string | 2nd city |
This function takes in array of objects and a comparison key or comparison function and returns a new array with unique items
* indicates required fields
| Parameter | Type | Description |
|---------|---------------|-----------------|-------------|
| arr* | T[] | Array of objects |
| predicate* | string | function | key of the object on which comparison will be done
or
pass your own function for comparison |