JSFiddle - React, Tailwind, and code Playground

by Plippie Plop

HTML

<div id="test" data-string1="" data-string3="true" data-string4="false" data-string5="0"></div>

JavaScript

var string1 = "";
var string2;
var string3 = "true";
var string4 = "0";
var string5 = 0;
var string6 = {};
var string7 = [];
var string8 = {data1:1,data2:2};
var string9 = ['item','item'];

var sdata = $("#test").data();

console.log("------------- !NOT + Output ---------------------");
console.log("STRING 1 IS NOT VALID:"+ (!string1) +'    Output: '+ (string1) );
console.log("STRING 2 IS NOT VALID:"+ (!string2) +'    Output: '+ (string2) );
console.log("STRING 3 IS NOT VALID:"+ (!string3) +'    Output: '+ (string3) );
console.log("STRING 4 IS NOT VALID:"+ (!string4) +'    Output: '+ (string4) );
console.log("STRING 5 IS NOT VALID:"+ (!string5) +'    Output: '+ (string5) );
console.log("STRING 6 IS NOT VALID:"+ (!string6) +'    Output: '+ (string6) );
console.log("STRING 7 IS NOT VALID:"+ (!string7) +'    Output: '+ (string7) );
console.log("STRING 8 IS NOT VALID:"+ (!string8) +'    Output: '+ (string8) );
console.log("STRING 9 IS NOT VALID:"+ (!string9) +'    Output: '+ (string9) );
console.log("div data 1 IS NOT VALID:"+ (!sdata.string1) +'   Output: '+ (sdata.string1) );
console.log("div data 2 IS NOT VALID:"+ (!sdata.string2) +'   Output: '+ (sdata.string2) );
console.log("div data 3 IS NOT VALID:"+ (!sdata.string3) +'   Output: '+ (sdata.string3) );
console.log("div data 4 IS NOT VALID:"+ (!sdata.string4) +'   Output: '+ (sdata.string4) );
console.log("div data 5 IS NOT VALID:"+ (!sdata.string5) +'   Output: '+ (sdata.string5) );