es2015 snippets

by Owen Buckley

JavaScript

var Calculator = function() {

  init = function() {
    /* some kind of constructor */
  }
  
  return {
    add: function() { /* public code here */ },
    substract: function() { /* public code here */ },
		divide: function() { /* public code here */ },
    multiply: function() { /* public code here */ }
  }
  
  
}

class Calculator {

	constructor() {
	  /* real constructor here */
	}
	
	add() {}
	subtract() {}
	divide() {}
	multiply() {}
}

export default Calculator;