Skip to content

Instantly share code, notes, and snippets.

@SeanJM
Created April 21, 2016 14:04

Revisions

  1. Sean MacIsaac created this gist Apr 21, 2016.
    8 changes: 8 additions & 0 deletions hasKey.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    function hasKey (object, key) {
    for (var k in object) {
    if (k === key && object.hasOwnProperty(key)) {
    return true;
    }
    }
    return false;
    }