What is the best way to check if two arrays have the same/equal values (in any order) in JavaScript?
These values are just a primary keys of database entities, so they always will be different
const result = [1, 3, 8, 77]
const same = [8, 3, 1, 77]
const diff = [8, 3, 5, 77]
areValuesTheSame(result, same) // true
areValuesTheSame(result, diff) // false
How should areValuesTheSame
method look like?
P.S. This question looks like a duplicate but I didn't find anything relative to Javascript.