Intersection of arrays in Javascript ES6


var roles = ['a', 'b', 'c']
var myRoles = ['b', 'c', 'd']

var intersection = roles.filter(r => myRoles.find(myR => r === myR) != null)
console.log(intersection)

Comentários

Postagens mais visitadas deste blog

Muitos planos, pouca vida

Amigo Secreto pode ser legal

Teste de carga