JSFiddle - React, Tailwind, and code Playground

by Dan Daniel

JavaScript

var array1 = [ 1, 2, 3, 4, 5 ];
var array2 = [ 2, 3 ];

var result = array1.filter( function ( elem ) {
    return array2.indexOf( elem ) === -1;
});

document.write( result );