JSFiddle - React, Tailwind, and code Playground

by javascriptenlightenment

HTML

<script src="https://getfirebug.com/firebug-lite-debug.js"></script>
<!-- disregard this pane, html is shown in the "result" pane -->




































































<h4><strong>&larr; Code Example from <a href="http://www.javascriptenlightenment.com/" target="_blank">JavaScript Enlightenment Book</a> by <a href="http://www.codylindley.com" target="_blank">Cody Lindley</a></strong></h4>

<p>JavaScript code is executed on page load. Click the "Run" button in the top bar to re-run the JavaScript code. Output is logged to the <a href="http://getfirebug.com/firebuglite" target="_blank">Firebug Lite</a> console below &darr;.</p>

JavaScript

var myString = 'string'
var myNumber = 10;
var myBoolean = false; // could be true or false, but that is it
var myNull = null;
var myUndefined = undefined;

console.log(myString, myNumber, myBoolean, myNull, myUndefined);

/* Consider that a complex object like array or object can be made up of multiple primitive values, and thus becomes a complex set of multiple values. */

var myObject = {
    myString: 'string', 
    myNumber: 10, 
    myBoolean: false, 
    myNull: null, 
    myUndefined: undefined
};

console.log(myObject);

var myArray = ['string', 10, false, null, undefined];

console.log(myArray);