JSFiddle - React, Tailwind, and code Playground
by Cody Lindley
HTML
<script src="https://dl.dropboxusercontent.com/u/2026291/firebug-lite-debug.js"></script>
JavaScript
var myObject = {
//name:'', WOULD CAUSE ERROR
get name() { //notice use of get to indicate accessor property
console.log('read name');
},
set name(value) { //notice use of set to indicate accessor property
console.log('wrote to name the value: ' + value);
}
};
myObject.name = 'codylindley'; //invokes set
myObject.name; //invokes get