Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript compare sets

var a = new Set([1,2,3]);
var b = new Set([1,3,2]);

alert(eqSet(a, b)); // true

function eqSet(as, bs) {
    if (as.size !== bs.size) return false;
    for (var a of as) if (!bs.has(a)) return false;
    return true;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: call function on modal open 
Javascript :: on spacebar press javascript 
Javascript :: (0 , _reactRouterDom.useHistory) is not a function 
Javascript :: content editable vuejs 
Javascript :: javascript remove duplicate letters in a string 
Javascript :: how to send a message to a discord server using a bot 
Javascript :: push-method-in-react-hooks-usestate 
Javascript :: ajax jquery errors 
Javascript :: sort array of objects javascript by date 
Javascript :: There might be a problem with the project dependency tree. It is likely not a bug in Create React App, but something you need to fix locally. 
Javascript :: js desktop notification 
Javascript :: rounding off numbers javascript 
Javascript :: javascript detect backspace 
Javascript :: javascript convert in a string the items of an array 
Javascript :: javascript newline in alert 
Javascript :: smooth scroll to target with offset 
Javascript :: nodejs wait function 
Javascript :: dropdown option selection change event in jquery 
Javascript :: check if there is page has scrollbar x js 
Javascript :: request body empty express 
Javascript :: react 17 hot reload not working 
Javascript :: how get value of json encode in laravel 
Javascript :: where to place async in const function 
Javascript :: vue dynamic component props 
Javascript :: cannot use import statement outside a module in jest 
Javascript :: get page link angular 
Javascript :: async arrow function 
Javascript :: ecmascript compose 
Javascript :: faker.js name 
Javascript :: javascript find 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =