JSFiddle - React, Tailwind, and code Playground

JavaScript

var test = { type: 3 };

if ( ~[1, 2, 3, 4].indexOf(test.type) ) {
    alert('woohooo!');
}