Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js check if two arrays contain same values

const a = ['Left', 'Right'];
const b = ['Right', 'Left'];

//	true if a and b contain the same values
//	false otherwise
const c = a.sort().join(',') === b.sort().join(',');
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #check #arrays #values
ADD COMMENT
Topic
Name
7+6 =