Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Comparing two lists in Javascript

const equals = (a, b) => JSON.stringify(a) === JSON.stringify(b);

const a = [1, 2, 3];
const b = [1, 2, 3];

equals(a, b); // true
Source by www.30secondsofcode.org #
 
PREVIOUS NEXT
Tagged: #Comparing #lists #Javascript
ADD COMMENT
Topic
Name
5+2 =