There are two arrays in JavaScript, they are both in the following format:
[{'drink':['alcohol', 'soft', 'hot']}, {'fruit':['apple', 'pear']}]; I need to detect if the two arrays are equal or not. they are considered equal if they contain the same elements in a different order. How can I make that?
[{'fruit':['pear', 'apple']}, {'drink':['alcohol', 'hot', 'soft']}]as elements is considered equal to the array you've shown? (note the pear/apple exchange)