Skip to content

Instantly share code, notes, and snippets.

@Cmdv
Created May 25, 2016 21:49

Revisions

  1. Vincent Orr created this gist May 25, 2016.
    9 changes: 9 additions & 0 deletions typercript-convert.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    function map (toSomething, obj) {
    const newObj = {}
    const keys = Object.keys(obj)
    for (let i = 0; i < keys.length; ++i) {
    const name = keys[i]
    newObject[name] = toSomething(obj[name])
    }
    return newObj
    }