JSFiddle - React, Tailwind, and code Playground
by Eugen Sunic
JavaScript
const array1 = [1, 5, 7]
const array2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23];
console.log(array1.map(x => array2.includes(x)))
by Eugen Sunic
const array1 = [1, 5, 7]
const array2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23];
console.log(array1.map(x => array2.includes(x)))