堆栈内存 作用域变量提升

/*阿里面试题*/

let a = {

n: 10

};

let b = a;

b.m = b = {

n: 20

};ß

console.log(a);

console.log(b);
let a=0,

b=0;

function A(a){

A=function(b){

alert(a+b++);

};

alert(a++);

}

A(1);

A(2);
var x = 10;

~ function (x) {

console.log(x);

x = x || 20 && 30 || 40;

console.log(x);

}();

console.log(x);
***

let x = [1, 2],

y = [3, 4];

~ function (x) {

x.push('A');

x = x.slice(0);

x.push('B');

x = y;

x.push('C');

console.log(x, y);

}(x);

console.log(x, y);
let res = parseFloat('left:200px');

if(res===200){

alert(200);

}else if(res===NaN){

alert(NaN);

}else if(typeof res==='number'){

alert('number');

}else{

alert('Invalid Number');

}

###

你可能感兴趣的:(堆栈内存 作用域变量提升)