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
// OOP | |
console.log( 'OHAI'.blink() ); | |
// Call invocation | |
console.log( String.prototype.blink.call('OHAI') ); | |
// $ always makes things look awesome. | |
var $ = Function.prototype.call; | |
// Very explicit call invocation |
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
var deepCopy = (function () { | |
var funcBlacklist = ['caller', 'arguments', 'prototype' ], | |
primitiveCloner = makeCloner(clonePrimitive), | |
cloneFunctions = { | |
'[object Null]': primitiveCloner, | |
'[object Undefined]': primitiveCloner, | |
'[object Number]': primitiveCloner, | |
'[object String]': primitiveCloner, | |
'[object Boolean]': primitiveCloner, | |
'[object RegExp]': makeCloner(cloneRegExp), |