阿里15年前端实习笔试
http://www.cnblogs.com/dongtianee/p/4571170.html
1、答案D
考察变量提升
2、答案B
null NaN undefined区别
http://www.jb51.net/article/35404.htm
3、答案B
考察变量提升
4、答案ABCD
考察ECMAScript新特性
A解构赋值
Bconst
C模板对象
D新的数据构造对象map
5、答案AD
6、答案ABCD
无内容元素不需要闭合
8、
<!
DOCTYPE
html>
<
html
>
<
head
>
<
meta
charset
=
"UTF-8"
>
<
title
></
title
>
</
head
>
<
style
>
.aa
{
display
:
inline-block
;
width
:
20
px
;
height
:
20
px
;
background
:
#fff
;
box-shadow
:
0
0
0
6
px
#a5a5a5
;
border-bottom
:
60
px
solid
#fff
;
border-top
:
20
px
solid
#fff
;
border-left
:
140
px
solid
#fff
;
border-right
:
20
px
solid
#fff
;
position
:
relative
;
}
.aa
:
before
{
position
:
absolute
;
content
:
" "
;
display
:
block
;
border-bottom
:
60
px
solid
#a5a5a5
;
border-left
:
40
px
solid
transparent
;
border-right
:
60
px
solid
transparent
;
left
:
-130
px
;
}
.aa
:
after
{
position
:
absolute
;
content
:
" "
;
display
:
block
;
border-bottom
:
50
px
solid
#a5a5a5
;
border-left
:
40
px
solid
transparent
;
border-right
:
60
px
solid
transparent
;
left
:
-90
px
;
top
:
10
px
;
}
.circle
{
width
:
25
px
;
height
:
25
px
;
border-radius
:
50
%
;
background
:
#a5a5a5
;
display
:
block
;
}
</
style
>
<
body
>
<
div
><
i
class
=
"aa"
><
i
class
=
"circle"
></
i
></
i
>
</
div
>
</
body
>
</
html
>
考察transparent ::before ::after伪元素
9、不会
优化
10、
function
fn
(
input
) {
input
=
parseInt(
input
,
10
);
return
isPrime(
input
)
?
alert(
"is prime"
)
:
alert(
"not prime"
);
}
function
isPrime
(
input
) {
var
a
=
0
for
(
var
i
=
2
; i
<
input
; i
++
)
if
(
input
%
i
==
0
) {
a
++
;
}
//alert("0");
if
(a
==
0
)
return
true
;
else return
false
;
}
fn(
11
);
parseInt 函数可解析一个字符串,并返回一个整数。
判断质数
11、题目都没怎么看懂
12、考察设置、获取、删除cookie
没怎么看懂
13、
考察z-index 如果两个元素重合,z-index高者会遮挡低者