Comparing Arrays
Perform a simple comparison between the given arrays. Return true if both the arrays carry the same elements and elements order. Otherwise false.
Sample Code:
function compArr(arr1,arr2) {
// Enter your logic here...
}
Examples:
Input: [1,2,3, {key:value}],[1,2,3,{key:value}]
Output: true
Explanation: Both have the same elements and elements order.
Input: [1,2,3],[1,2,'3']
Output: false
Explanation: '3' is not equivalent to 3 due to different data types.