Skip to content

Instantly share code, notes, and snippets.

@arafeek
Created July 31, 2015 03:41
Show Gist options
  • Save arafeek/856c2f12d24e84fe4f22 to your computer and use it in GitHub Desktop.
Save arafeek/856c2f12d24e84fe4f22 to your computer and use it in GitHub Desktop.

Revisions

  1. arafeek created this gist Jul 31, 2015.
    10 changes: 10 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    function set(obj, property, value) {
    var properties = R.split('.',property);
    var context = obj;

    var i;
    for(i=0; i < properties.length -1; i++) {
    context = context[properties[i]];
    }
    context[properties[i]] = value;
    }