Skip to content

Instantly share code, notes, and snippets.

@kovaldn
Created December 5, 2013 06:34
Show Gist options
  • Select an option

  • Save kovaldn/7801078 to your computer and use it in GitHub Desktop.

Select an option

Save kovaldn/7801078 to your computer and use it in GitHub Desktop.

Revisions

  1. kovaldn created this gist Dec 5, 2013.
    16 changes: 16 additions & 0 deletions stackoverflow
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    var userB = {
    sayHello: function() {
    console.log('Hello '+ this.name);
    }
    };

    var bob = Object.create(userB, {
    'id' : {
    value: MY_GLOBAL.nextId(),
    enumerable:true // writable:false, configurable(deletable):false by default
    },
    'name': {
    value: 'Bob',
    enumerable: true
    }
    });