www.qjdy.com-奇迹赌场 > www.qjdy.com > javascript练习题

原标题:javascript练习题

浏览次数:172 时间:2019-08-29

javascript练习题

题1

var a = 1;
var b = a;
a = 2;

b = ?答案:b=1;题2

var a = {a1:1, a2:2}, 
b = a;
a.a1 = 3;

b.a1 = ?答案:b.s=3;题3

function sum(a){
  a = a   1;
  return a;
}
var a = 1;
var obj = {a:1, b:2};

sum(a) = ?a = ?;答案:sum(a)=2;a=1;sum(obj.a) = ?;obj.a = ?;答案:sum(obj.a)=2;obj.a=1;题3

var a = 1;
function sum(){  
  a = 2;  
  var a;  
  alert(a);
}
sum();

答:2题4

if(true){
  var b=2;
}
alert(b);
if(false){
  var c = 1;
}
alert(c);

答:2,undefined题5

alert(10&5|13);

答:13题6

function stealthCheck(){
   var ret = stealth();
  alert( ret, We'll never get below the return, but that's OK! )
   return true;
   function stealth(){ return true; }
}
stealthCheck();

答:true

题1 var a = 1;var b = a;a = 2; b = ?答案:b=1;题2 var a = {a1:1, a2:2}, b = a;a.a1 = 3; b.a1 = ?答案:b.s=3;题3 function sum(a){ a = a 1; return a;}v...

本文由www.qjdy.com-奇迹赌场发布于www.qjdy.com,转载请注明出处:javascript练习题

关键词: NE电子游戏

上一篇:不要将表单组合输入框组混合使用

下一篇:没有了