9.2做JS的题目

1.请问在javascript程序中,alert(undefined==null)的输出结果是  true

2.JavaScript中document.getElementById的返回值的类型为?  object

3在jquery中想要实现通过远程http get请求载入信息功能的是下面的哪一下事件?$.get(url)

4.

 1 function Foo(){
 2      var i=0;
 3      return function(){
 4          document.write(i++);
 5      }
 6 }
 7 var f1=Foo(),
 8 f2=Foo();
 9 f1();
10 f1();
11 f2();

010

5.

 1 <html>
 2  <head>
 3  <script>
 4  function myFunc() {
 5  document.write(a);// a已变量提升,但是因为赋值在后面,所以打印undefined
 6  document.write(func());// 执行函数 打印出2
 7  var a = 1;
 8  function func() {
 9  return 2;
10  }
11  }
12  </script>
13  </head>
14  <body>
15  <p>1</p>
16  <button onclick = "myFunc()">点击</button>
17  </body>
18  </html>

变量提升,赋值不提升undefined2

6.typeof Date.now() 的值是:&quot;number&quot;

Date.now() 方法返回自1970年1月1日 00:00:00 UTC到当前时间的毫秒数。为number

7.代码var foo = "10"+3-"1";console.log(foo);执行后,foo的值为( )102

B,+号是字符串拼接,减号是算法

8.JS里的function能访问它们的()ABCD

A参数

B局部变量或函数

C全局变量

D外部函数的变量或函数

原文地址:https://www.cnblogs.com/smhyu/p/13602401.html