Check If 2 Arrays Have Same Values Javascript
Check If 2 Arrays Have Same Values Javascript . Const b = [1, 2, 3]; Const a = [1, 2, 3]; Hacks for Creating JavaScript Arrays from www.freecodecamp.org To check if multiple values exist in an array: First, we have sorted the arrays and then we have directly equated array2 to array1. One way to check if 2 javascript arrays have the same items in them is to sort them and then convert them to a string.