x.test()调用为何会报错? y.test()却是没问题的?
var x=function(val){
console.info('the value is: ', val);
function len(val){
if (typeof val=='undefined'){
console.info('no source path specified')
}
console.info('nested len function called from ', val);
}
var test=function(){
console.info('test');
}
}
var y={
test:function(){
console.info('function defined in y');
}
}
x('haha');
x('jindezhen');
console.info(typeof x.len);
y.test();
// x.test();