在一个js函数里面获取另一个js函数的变量

function a(){

var a =1;

return a;

}

function b(){

var b = a();

}

这时b就拿到了a函数中 的a的值

你可能感兴趣的:(小方法)