JSFiddle - React, Tailwind, and code Playground

by ryan Couch

JavaScript

function ReplaceNULL(obj) {
    return (typeof obj === 'number' || obj === 'undefined' && obj) ? obj : "None";
}

var mything = 0;
alert(typeof mything + ": " + ReplaceNULL(mything));

var mything2;
alert(typeof mything2 + ": " + ReplaceNULL(mything2));

var mything3 = "wtf";
alert(typeof mything3 + ": " + ReplaceNULL(mything3));