2018 年 12 月份面试题
- 阅读代码,立即执行函数
运算符的优先级 https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Operator_Precedence
js
/**1*/
var name1 ='World!';
(function(){
console.log(this);
if(typeof name1 === 'undefined'){
var name1 ='JACK';
console.log('hello,'+name1)
}else{
console.log('Goodbye' + name1)
}
})();
/**2 运算符的优先级*/
var val= "hello";
console.log ('Value is' +(val==="hello")?'Something':'Nothing');