There are two arrays in JavaScript, they are both in the following format:
[{\'drink\':[\'alcohol\', \'soft\', \'hot\']}, {\'fruit\':[\'apple\', \'pear\']}];
You can try this JSON.stringify(array1)===JSON.stringify(array2); if you want the order also to be identical in both the arrays.
JSON.stringify(array1)===JSON.stringify(array2);