Skip to content

Instantly share code, notes, and snippets.

View mienaikoe's full-sized avatar
🍞
making the bread

Jesse mienaikoe

🍞
making the bread
View GitHub Profile
@xmlking
xmlking / Enum.es6.js
Last active June 25, 2019 18:09
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;