JSFiddle - React, Tailwind, and code Playground

JavaScript

var otherThanNull = [null, null, 2, null].some(function (el) {
  return el !== null;
});

console.log(otherThanNull);