JSFiddle - React, Tailwind, and code Playground

by chicagogrooves

HTML

<pre id="meow"/>

CoffeeScript

class Cat
  defaults:
    name: 'tabby'
    weight: 5
    
  constructor: (@options) ->
    opts = @options
    $.each @defaults, (key, val) ->
      opts[key] = val unless opts.hasOwnProperty(key)
    
c = new Cat(name: 'fluffy')
$("#meow").text( JSON.stringify(c.options) )