JSFiddle - React, Tailwind, and code Playground
JavaScript
var x = [-123,-10,-1,0,1,2,60];
var process = function(x){
return 1*!x;
}
for (i = 0; i<x.length; i++) {
document.write('input "' + x[i] + '" will give output: "' + process(x[i]) + '"<br />');
}