You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var n = {};
n.n = 10;
function ajax(){
var obj = {a:1, n:2}
var {a, n} = obj;
console.log("没想到吧,我又来了", n)
var fun = function(n){
console.log(n)
}
}
function test(){
n = 5;
var fun = function(){
console.log(n)
}
}
function test2(n){
n = 5;
}
ajax()
需要顶级n为abc,替换后代码为:
var abc = {};
abc.n = 10;
function ajax() {
var obj = {
a: 1,
n: 2
};
var {
a,
n
} = obj;
console.log("没想到吧,我又来了", n);
var fun = function (n) {
console.log(n);
};
}
function test() {
abc = 5;
var fun = function () {
console.log(abc);
};
}
function test2(n) {
n = 5;
}
ajax();
比如代码:
需要顶级n为abc,替换后代码为:
使用babel,仅三行解决:
使用gogocode,我还没法像这么简洁的弄出来,可以预想到,会有一堆代码。
The text was updated successfully, but these errors were encountered: