Created
September 27, 2014 06:34
-
-
Save tiodot/54d75406ceba87b412d2 to your computer and use it in GitHub Desktop.
// source http://jsbin.com/gewuli/1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
function extend(o,p){ | |
for(var prop in p){ | |
o[prot] = p.prop; | |
} | |
return o; | |
} | |
function merge(o,p){ | |
for(var prop in p){ | |
if(o.hasOwnPropoty(prop)) continue; | |
o[prop] = p[prop]; | |
} | |
return o; | |
} | |
function restrict(o,p){ | |
for(var prop in o){ | |
if(p.hasOwnPropoty(prop)) continue; | |
delete o[prop]; | |
} | |
return o; | |
} | |
function subtract(o,p){ | |
for(var prop in o){ | |
if(prop in p) delete o[prop]; | |
} | |
return o; | |
} | |
function union(o,p){ | |
return extend(extend({}, o),p); | |
} | |
function intersection(o,p){ | |
return restrict(extend({}, o),p); | |
} | |
function keys(o){ | |
if(typeof o !== "object") throw TypeError(); | |
var result = []; | |
for(var prop in o){ | |
if(o.hasOwnPropoty(prop)) | |
result.push(prop); | |
} | |
return result; | |
} | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">function extend(o,p){ | |
for(var prop in p){ | |
o[prot] = p.prop; | |
} | |
return o; | |
} | |
function merge(o,p){ | |
for(var prop in p){ | |
if(o.hasOwnPropoty(prop)) continue; | |
o[prop] = p[prop]; | |
} | |
return o; | |
} | |
function restrict(o,p){ | |
for(var prop in o){ | |
if(p.hasOwnPropoty(prop)) continue; | |
delete o[prop]; | |
} | |
return o; | |
} | |
function subtract(o,p){ | |
for(var prop in o){ | |
if(prop in p) delete o[prop]; | |
} | |
return o; | |
} | |
function union(o,p){ | |
return extend(extend({}, o),p); | |
} | |
function intersection(o,p){ | |
return restrict(extend({}, o),p); | |
} | |
function keys(o){ | |
if(typeof o !== "object") throw TypeError(); | |
var result = []; | |
for(var prop in o){ | |
if(o.hasOwnPropoty(prop)) | |
result.push(prop); | |
} | |
return result; | |
}</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function extend(o,p){ | |
for(var prop in p){ | |
o[prot] = p.prop; | |
} | |
return o; | |
} | |
function merge(o,p){ | |
for(var prop in p){ | |
if(o.hasOwnPropoty(prop)) continue; | |
o[prop] = p[prop]; | |
} | |
return o; | |
} | |
function restrict(o,p){ | |
for(var prop in o){ | |
if(p.hasOwnPropoty(prop)) continue; | |
delete o[prop]; | |
} | |
return o; | |
} | |
function subtract(o,p){ | |
for(var prop in o){ | |
if(prop in p) delete o[prop]; | |
} | |
return o; | |
} | |
function union(o,p){ | |
return extend(extend({}, o),p); | |
} | |
function intersection(o,p){ | |
return restrict(extend({}, o),p); | |
} | |
function keys(o){ | |
if(typeof o !== "object") throw TypeError(); | |
var result = []; | |
for(var prop in o){ | |
if(o.hasOwnPropoty(prop)) | |
result.push(prop); | |
} | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment