JSFiddle

  • getValue for objects. #1 is the latest revision

    Clean way to get object data w/o worrying about undefined.

    getValue = function(obj, key) {
        return key.split(".").reduce(function(o, x) {
            return (typeof o == "undefined" || o === null) ? o : o[x ...
  • Most Basic Promise, I Promise

    Simple Promise Example

    delay().then(function(response) {
    	console.dir(response);
    	alert('Promised!');
    });
    
    function delay() {
    	return new Promise(function(resolve,reject) {
      	for(var i ...