JSFiddle - React, Tailwind, and code Playground

by Derek Anderson

JavaScript

var test = $('.nonexist');
// falsey value
//var test = $('.nonexist')[0];

if(test){
     alert('test was truthy');   
}

if(!test){
     alert('test was falsey');   
}