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
let copy = list.map(i => i); |
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
## The Problem | |
value = 'external' | |
console.log 1, value # 'external' | |
(someFunction = => | |
console.log 2, value # 'external' | |
value = 'internal' | |
console.log 3, value # 'internal' | |
)() |
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
merge = (left, right) -> | |
return left unless (typeof left is typeof right is 'object') and right isnt null | |
return left unless (Array.isArray left) is (Array.isArray right) | |
ret = if Array.isArray left then [] else {} | |
for key, value of left | |
ret[key] = left[key] | |
for own key, value of right | |
if key of ret | |
ret[key] = merge ret[key], right[key] | |
else |
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
@__deserializeFunction = __deserializeFunction = (argumentArray)-> | |
Function.apply {}, argumentArray | |
@__serializeFunction = __serializeFunction = (fn)-> | |
deSF = fn.toString() | |
temp = deSF.indexOf '(' | |
temp1 = deSF.indexOf ')' | |
declaration = deSF.substring temp+1, temp1 |