Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript 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: #javascript #check #arrays #values
ADD COMMENT
Topic
Name
7+1 =