首页 > 代码库 > 【avalon源码】scpCompile

【avalon源码】scpCompile

function noop() {}function scpCompile(array) {    return Function.apply(noop, array)}// var fn = new Function(‘x‘, ‘y‘, ‘return x + y;‘);// 等价于var fn = function(x, y) {return x + y;}var fn = scpCompile([‘x‘, ‘y‘, ‘return x + y;‘])console.log(fn)

 

技术分享

【avalon源码】scpCompile