JSFiddle - React, Tailwind, and code Playground

by fresheyeball

HTML

<div>test</div>

CoffeeScript

class Person
    that             = @
    @totalPeople     = 0
    fertility        = true
    
    naturalDeath     = (age) -> (age > 110)
    
    constructor : (name, @age) ->
        if fertitlity
            name = name.split ' '
            @firstName    = name[0]
            @lastName     = name[1] ? ''
            @isAlive      = naturalDeath @age       
            that.totalPeople++
        else
            throw new Error "Humanity is sterile, we are screwed"
    
    birthday : ->
        @isAlive = naturalDeath(@age)
        @age++ if @isAlive
    
    @destroyFertility = -> fertility = false
    
class Worker
    that             = @
    @totalWorkers    = 0
    
    constructor : (name, age, @salary) ->
        super name, age
        that.totalWorkers++
        
    raise : (raise) ->
        @salary += raise

do ->
    console.log 'yo'
    jeff = new Worker "Jeffery Livid", 45, 50000
    sarah = new Worker "Sarah Franklen", 43, 63000
    
    alert jeff.firstName
    alert sarah.lastName
    alert Person.totalPeople