1,以下表达式的运行结果是:

["1","2","3"].map(parseInt)

A.["1","2","3"]

B.[1,2,3]

C.[0,1,2]

D.其他 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

2,以下表达式的运行结果是:

[typeof null, null instanceof Object]

A.["object",false]

B.[null,false]

C.["object",true]

D.其他
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

3,以下表达式的运行结果是:

[[3,2,1].reduce(Math.pow),[].reduce(Math.pow)]

A.报错

B.[9,0]

C.[9,NaN]

D.[9,undefined]
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

4,以下表达式的运行结果是:

var val = 'value';
console.info('Value id '+(val === 'value')?'Something':'Nothing'); A.Something B.Nothing C.NaN D.其他
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

5,以下表达式的运行结果是:

var name = 'World';
(function(){
if(typeof name === 'undefined'){
var name = "Jack";
console.info('Goodbye '+ name);
}else{
console.info('Hello ' + name);
}
})(); A.Goodbye Jack B.Hello Jack C.Goodbye undefined D.Hello undefined
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

6,以下表达式的运行结果是:

var END = Math.pow(2,53);
var START = END -100;
var count = 0; for(var i = START ; i <= END ;i++){
count ++;
}
console.log(count); A.0 B.100 C.101 D.其他
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

7,以下表达式的运行结果是:

var arr = [0,1,2];
arr[10] = 10;
arr.filter(function(x){return x === undefined}); A.[undefined x 7] B.[0,1,2,10] C.[] D.[undefined]
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

8,以下表达式的运行结果是:

var two = 0.2;
var one = 0.1;
var eight = 0.8;
var six = 0.6;
[two -one == one,eight- six == two]; A.[true,true] B.[false,false] C.[true,false] D.其他
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

9,以下表达式的运行结果是:

function showCase(value){

switch(value){
case 'A':
console.info('Case A');
break;
case 'B':
console.info('Case B');
break;
case undefined :
console.info('undefined');
break;
default:
console.info('Do not know!');
}
}
showCase(new String('A')); A.Case A B.Case B C.Do not know D.undefined
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25

10,以下表达式的运行结果是:

function showCase(value){

    switch(value){
case 'A':
console.info('Case A');
break;
case 'B':
console.info('Case B');
break;
case undefined :
console.info('undefined');
break;
default:
console.info('Do not know!');
}
}
showCase(String('A')); A.Case A B.Case B C.Do not know D.undefined
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26

11,以下表达式的运行结果是:

function isOdd(num){
return num % 2 == 1;
}
function isEven(num){
return num % 2 == 0;
}
function isSane(num){
return isEven(num)||isOdd(num);
}
var values = [7,4,'13',-9,Infinity];
values.map(isSane); A.[true, true, true, true, true] B.[true, true, true, true, false] C.[true, true, true, false, false] D.[true, true, false, false, false]
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19

12,以下表达式的运行结果是:

[parseInt(3,8),parseInt(3,2),parseInt(3,0)]

A.[3,3,3]

B.[3,3,NaN]

C.[3,NaN,NaN]

D.其他
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

13,以下表达式的运行结果是:

Array.isArray(Array.prototype)

A.true

B.false

C.报错

D.其他
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

14,以下表达式的运行结果是:

var a = [0];
if([0]){
console.info(a == true);
}else{
console.info("else");
} A.true B.false C."else" D.其他
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

15,以下表达式的运行结果是:

[]==[]

A.true

B.false

C.报错

D.其他
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

16,以下表达式的运行结果是:

[('5'+3),('5'-3)]

A.["53",2]

B.[8,2]

C.报错

D.其他
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

17,以下表达式的运行结果是:

1+-+++-+1

A.true

B.false

C.报错

D.其他 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

18,以下表达式的运行结果是:

var arr = Array(3);
arr[0] = 2
arr.map(function(elem){return '1';}); A.[2,1,1] B.["1","1","1"] C.[2,"1","1"] D.其他
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

19,以下表达式的运行结果是:

function sidEffecting(arr){
arr[0] = arr[2];
}
function bar(a,b,c){
c = 10;
sidEffecting(arguments);
return a+b+c;
}
bar(1,1,1); A.3 B.12 C.报错 D.其他
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

20,以下表达式的运行结果是:

var a = 111111111111111110000;
b = 1111;
console.info(a+b); A.111111111111111111111 B.111111111111111110000 C.NaN D.Infinity
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

21,以下表达式的运行结果是:

ar x = [].reverse;
x(); A.[] B.undefined C.报错 D.window
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

22,以下表达式的运行结果是:

Number.MIN_VALUE>0

A.true

B.false

C.报错

D.其他
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

23,以下表达式的运行结果是:

[1<2<3,3<2<1]

A.[true,true]

B.[true,false]

C.报错

D.其他
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

24,以下表达式的运行结果是:

2 == [[[2]]]

A.true

B.false

C.undefined

D.其他
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

25,以下表达式的运行结果是:

[3.toString(),3..toString(),3...toString()]

A.["3",error,error]

B.["3","3.0",error]

C.[error,"3",error]

D.其他
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

26,以下表达式的运行结果是:

(function(){
var x1 =y1 =1;
})(); console.info(y1);
console.info(x1); A.1,1 B.error,error C.1,error D.其他
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

27,以下表达式的运行结果是:

var a = Function.length,
b = new Function().length;
a === b A.true
B.false
C.error
D.other
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

28,以下表达式的运行结果是:

var a = Date(0);
var b = new Date(0);
var c = new Date();
[a === b, b === c, a === c] A.[true, true, true]
B.[false, false, false]
C.[false, true, false]
D.[true, false, false]
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

29,以下表达式的运行结果是:

var min = Math.min(), max = Math.max()
min < max A.true
B.false
C.error
D.other
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

30,以下表达式的运行结果是:

function captureOne(re, str) {
var match = re.exec(str);
return match && match[1];
}
var numRe = /num=(\d+)/ig,
wordRe = /word=(\w+)/i,
a1 = captureOne(numRe, "num=1"),
a2 = captureOne(wordRe, "word=1"),
a3 = captureOne(numRe, "NUM=2"),
a4 = captureOne(wordRe, "WORD=2");
[a1 === a2, a3 === a4] A.[true, true]
B.[false, false]
C.[true, false]
D.[false, true]
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

31,以下表达式的运行结果是:

var a = new Date("2014-03-19"),
b = new Date(2014, 03, 19);
[a.getDay() === b.getDay(), a.getMonth() === b.getMonth()] A.[true, true]
B.[true, false]
C.[false, true]
D.[false, false]
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

32,以下表达式的运行结果是:

if ('http://giftwrapped.com/picture.jpg'.match('.gif')) {
'a gif file'
} else {
'not a gif file'
} A.'a gif file'
B.'not a gif file'
C.error
D.other
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

33,以下表达式的运行结果是:

function foo(a) {
var a;
return a;
}
function bar(a) {
var a = 'bye';
return a;
}
[foo('hello'), bar('hello')] A.["hello", "hello"]
B.["hello", "bye"]
C.["bye", "bye"]
D.other
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

34,以下表达式的运行结果是:

var a = {class: "Animal", name: 'Fido'};
a.class A."Animal"
B.Object
C.an error
D.other
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

35,以下表达式的运行结果是:

var a = new Date("epoch")

A.Thu Jan 01 1970 01:00:00 GMT+0100 (CET)
B.current time
C.error
D.other
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

36,以下表达式的运行结果是:

var a = /123/,
b = /123/;
a == b
a === b A.true, true
B.true, false
C.false, false
D.other
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

37,以下表达式的运行结果是:

What is the result of this expression? (or multiple ones)

var a = [1, 2, 3],
b = [1, 2, 3],
c = [1, 2, 4]
a == b
a === b
a > c
a < c A.false, false, false, true
B.false, false, false, false
C.true, true, false, true
D.other
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

38,以下表达式的运行结果是:

var a = {}, b = Object.prototype;
[a.prototype === b, Object.getPrototypeOf(a) === b] A.[false, true]
B.[true, true]
C.[false, false]
D.other
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

39,以下表达式的运行结果是:

function f() {}
var a = f.prototype, b = Object.getPrototypeOf(f);
a === b A.true
B.false
C.null
D.other
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

40,以下表达式的运行结果是:

function foo() { }
var oldName = foo.name;
foo.name = "bar";
[oldName, foo.name] A.error
B.["", ""]
C.["foo", "foo"]
D.["foo", "bar"]
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

41,以下表达式的运行结果是:

"1 2 3".replace(/\d/g, parseInt)

A."1 2 3"
B."0 1 2"
C."NaN 2 3"
D."1 NaN 3"
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

42,以下表达式的运行结果是:

function f() {}
var parent = Object.getPrototypeOf(f);
f.name // ?
parent.name // ?
typeof eval(f.name) // ?
typeof eval(parent.name) // ? A."f", "Empty", "function", "function"
B."f", undefined, "function", error
C."f", "Empty", "function", error
D.other
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

43,以下表达式的运行结果是:

var lowerCaseOnly =  /^[a-z]+$/;
[lowerCaseOnly.test(null), lowerCaseOnly.test()] A.[true, false]
B.error
C.[true, true]
D.[false, true]
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

44,以下表达式的运行结果是:

var lowerCaseOnly =  /^[a-z]+$/;
[lowerCaseOnly.test(null), lowerCaseOnly.test()] A.[true, false]
B.error
C.[true, true]
D.[false, true]
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

45,以下表达式的运行结果是:

[,,,].join(", ")

A.", , , "
B."undefined, undefined, undefined, undefined"
C.", , "
D.""
转载 http://blog.csdn.net/i10630226/article/details/49765737

你不知道的JavaScript--值得你挑战的JavaScript面试题(45题)的更多相关文章

  1. 20 个值得一试的JavaScript 框架

      投递人 itwriter 发布于 2011-09-26 17:46 评论(3) 有1956人阅读 原文链接 [收藏] « » 本文介绍 20 个值得一试的 JavaScript 框架,如果你认为答 ...

  2. RX学习笔记:FreeCodeCamp的JavaScript基本算法挑战

    FreeCodeCamp的JavaScript基本算法挑战 https://www.freecodecamp.com 2016-07-03 JavaScript还不是非常熟悉,用已经会的知识来解这些题 ...

  3. JavaScript总体的介绍【JavaScript介绍、定义函数方式、对象类型、变量类型】

    什么是JavaScript? 我们可以从几个方面去说JavaScript是什么: 基于对象 javaScript中内置了许多对象供我们使用[String.Date.Array]等等 javaScrip ...

  4. JavaScript 工具库:Cloudgamer JavaScript Library v0.1 发布

    JavaScript 工具库:Cloudgamer JavaScript Library v0.1 发布   研究了一年多的js,也差不多写一个自己的js库了.我写这个不算框架,只是一个小型的js工具 ...

  5. href="javascript:xxx(this);"和onclick="javascript:xxx(this);"的区别

    href="javascript:xxx(this);"和onclick="javascript:xxx(this);" 一直以为这两种写法是等同的,今天在项目 ...

  6. JavaScript可否多线程? 深入理解JavaScript定时机制

    JavaScript的setTimeout与setInterval是两个很容易欺骗别人感情的方法,因为我们开始常常以为调用了就会按既定的方式执行, 我想不少人都深有同感, 例如 setTimeout( ...

  7. JavaScript强化教程——Cocos2d-JS中JavaScript继承

    javaScript语言本身没有提供类,没有其它语言的类继承机制,它的继承是通过对象的原型实现的,但这不能满足Cocos2d-JS引擎的要求.由于Cocos2d-JS引擎是从Cocos2d-x演变而来 ...

  8. 前端之JavaScript第一天学习(1)-JavaScript 简介

    javaScript 是世界上最流行的编程语言. 这门语言可用于 HTML 和 web,更可广泛用于服务器.PC.笔记本电脑.平板电脑和智能手机等设备. JavaScript 是脚本语言 JavaSc ...

  9. 【JavaScript】理解与使用Javascript中的回调函数

    在Javascript中,函数是第一类对象,这意味着函数可以像对象一样按照第一类管理被使用.既然函数实际上是对象:它们能被“存储”在变量中,能作为函数参数被传递,能在函数中被创建,能从函数中返回. 因 ...

随机推荐

  1. MySQL(四) —— 操作数据表中的记录

    插入记录 INSERT [INTO] tbl_name [(col_name,...)] {VALUES | VALUE} ({expr | DEFAULT},...),(...),... //法二: ...

  2. 加载xib文件

    // Test.xib --编译--> Test.nib // 方式1 NSArray *objs = [[NSBundle mainBundle] loadNibNamed:@"Te ...

  3. STORM_0002_在做好的zookeeper集群上搭建storm的开发环境

    参考文献http://www.cnblogs.com/panfeng412/archive/2012/11/30/how-to-install-and-deploy-storm-cluster.htm ...

  4. Codeforces Round #376 (Div. 2) F. Video Cards 数学,前缀和

    F. Video Cards time limit per test 1 second memory limit per test 256 megabytes input standard input ...

  5. 使用xml来显示获取的mysql数据

    mysql test -u test -X -e 'select * from employees where empid = 1' 其中 -X 就是以xml形式显示

  6. javascript学习-原生javascript的小特效(多个运动效果整理)

    以下代码就不详细解析了,在我之前的多个运动效果中已经解析好多次了,重复的地方这里就不说明了,有兴趣的童鞋可以去看看之前的文章<原生javascript的小特效> <!DOCTYPE ...

  7. 管道寄售库存MRKO结算后,冲销问题

    管道寄售库存MRKO结算后,冲销问题 1.通常使用MIRO对采购订单进行发票校验后,若发现校验错误,直接使用MR8M取消发票校验,同时手工F-03对借发票校验借方GRIR和取消发票校验的贷方GRIR进 ...

  8. 让你分分钟读懂CPU架构及芯片厂商

    CPU架构是CPU厂商给属于同一系列的CPU产品定的一个规范,主要目的是为了区分 不同类型CPU的重要标示.目前市面上的CPU指令集分类主要分有两大阵营,一个是intel.AMD为首的复杂指令集CPU ...

  9. css+js实现兼容性select的样式

    <!doctype html><html lang="en"> <head> <meta charset="UTF-8" ...

  10. JAVA入门 第五周 1多项式

    1 多项式加法(5分) 题目内容: 一个多项式可以表达为x的各次幂与系数乘积的和,比如: 现在,你的程序要读入两个多项式,然后输出这两个多项式的和,也就是把对应的幂上的系数相加然后输出. 程序要处理的 ...