阿里15年前端实习笔试-做的答案

来源:互联网 发布:php阿里蜘蛛池 编辑:程序博客网 时间:2024/05/21 07:00
阿里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
考察HTML5新标签  http://www.cnblogs.com/yuzhongwusan/archive/2011/11/17/2252208.html
6、答案ABCD
无内容元素不需要闭合
8、
<! DOCTYPE html>
< html>

    < head>
         < meta charset= "UTF-8">
         < title></title >
    </ head>
    < style>
          .aa {
              display: inline-block;
              width: 20px;
              height: 20px;
              background: #fff;
              box-shadow: 0 0 0 6px #a5a5a5;
              border-bottom: 60px solid #fff ;
              border-top: 20px solid #fff ;
              border-left: 140px solid #fff ;
              border-right: 20px solid #fff ;
              position: relative;
          }
         
          .aa:before {
              position: absolute;
              content: " ";
              display: block;
              border-bottom: 60px solid #a5a5a5 ;
              border-left: 40px solid transparent ;
              border-right: 60px solid transparent ;
              left: -130px;
          }
         
          .aa:after {
              position: absolute;
              content: " ";
              display: block;
              border-bottom: 50px solid #a5a5a5 ;
              border-left: 40px solid transparent ;
              border-right: 60px solid transparent ;
              left: -90px;
              top: 10px;
          }
         
          .circle {
              width: 25px;
              height: 25px;
              border-radius: 50%;
              background: #a5a5a5;
              display: block;
          }
     </style>

    < body>
         < div><i class="aa" ><i class="circle" ></i></ i>
         </ div>
    </ body>

</ html>
考察transparent ::before  ::after伪元素
display:block  http://jingyan.baidu.com/article/fcb5aff785f553edaa4a71db.html
9、不会
indexof  http://www.jb51.net/article/44763.htm
优化
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高者会遮挡低者
0 0