JSFiddle - React, Tailwind, and code Playground

by senica

HTML

<script src="https://getfirebug.com/firebug-lite-debug.js"></script>

JavaScript

var codes = {
    'hi': 'This is a test',
    'what': 'What is this?',
}

var e = Object.create({}, {
    _errors: {
      value: [],
      writable: true,
      enumerable: false,
      configurable: false,
    },
    errors: {
      enumerable: true,
      configurable: false,
      set: function(code){
        //console.log('set', this);
        error = {error: codes[code], code: code};
        this._errors.push(error);
        return error;
      },
      get: function(){
        //console.log('get', this);
        return this._errors;
      }
    }
  })

e.errors = 'hi';
e.errors = 'what';
console.log('Working', e.errors)

var noworky = e.errors;
noworky = 'hi';
console.log('Not Working', noworky)