Skip to content

Instantly share code, notes, and snippets.

View Leglaw's full-sized avatar

Craig Hess Leglaw

  • Shamrock Trading Corporation
  • Overland Park, KS
View GitHub Profile
@Leglaw
Leglaw / Enum.es6.js
Created November 14, 2015 06:21 — forked from xmlking/Enum.es6.js
JavaScript Enums with ES6, Type Checking and Immutability
export class EnumSymbol {
sym = Symbol.for(name);
value: number;
description: string;
constructor(name: string, {value, description}) {
if(!Object.is(value, undefined)) this.value = value;
if(description) this.description = description;