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 myObject = new Object(); // produces an Object() object
myObject['0'] = 'f';
myObject['1'] = 'o';
myObject['2'] = 'o';

console.log(myObject); // logs Object { 0="f", 1="o", 2="o"}

var myString = new String('foo'); // produces a String() object

console.log(myString); // logs foo { 0="f", 1="o", 2="o"}