Skip to content

Instantly share code, notes, and snippets.

@dmshvetsov
Last active December 21, 2020 06:17
Show Gist options
  • Save dmshvetsov/8cce0cb6074b8fb47035178ee7472f3c to your computer and use it in GitHub Desktop.
Save dmshvetsov/8cce0cb6074b8fb47035178ee7472f3c to your computer and use it in GitHub Desktop.
WIP; Consider using with Quokka.js
const K = 1000
const M = 1000 * K
const KB = 1000
const MB = 1000 * KB
const GB = 1000 * MB
const TB = 1000 * GB
const PB = 1000 * TB
function Calc () {
this.value = 100 * K
this.derivedValue = this.value * 10
}
const c = new Calc()
for (let prop in c) {
console.log(prop, c[prop])
}
// TODO write format function for byte sizes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment