This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OrderStatus { | |
constructor(name, nextStatus) { | |
this.name = name; | |
this.nextStatus = nextStatus; | |
} | |
doSomething() { | |
console.log('Do nothing by default'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ShoppingCart { | |
constructor(discount) { | |
this.discount = new discount(); | |
this.amount = 0; | |
} | |
checkout() { | |
return this.discount.apply(this.amount); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const http = require('http'); | |
const url = require('url'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const [ runtime, scriptName, port = 3000, folder = process.cwd() ] = process.argv; | |
class Server { |
OlderNewer