zoukankan      html  css  js  c++  java
  • 个人觉得一些有灵感的前端面试题

    !important :勤于思考,遇到熟悉但没有思考过的问题,可以思考两分钟,如果完全不会的,才不答,万一答对了,面试加分

    1. console.log输出什么

    function Test(o) {
            this.name = '张三'
            this.getName =function() {
                console.log(this.name)
            }
            o.ok({
                getName: this.getName
            })
        }
        new Test({
            ok: function(o) {
                o.getName()
            }
        })
    

      答案:undefined

    1.jquery为什么要用闭包

     2.keep-alive什么场景要使用

    3.查询css兼容性网站

    4.js for循环包裹异步

    问题:

    var arr = [1,3,5,7,9];
    var arrLength = arr.length;
    
    for (var i = 0; i < arrLength; i++) {
        setTimeout(function() {
            console.log(i);
            console.log(arr[i]);
        }, 2000);
    }

    解决:

    var arr = [1,3,5,7,9];
    var arrLength = arr.length;
    
    for (var i = 0; i < arrLength; i++) {
        (function(i) {
            setTimeout(function() {
                console.log('i是' + i);
                console.log('value是' + arr[i]);
            }, 2000);
        })(i);
    }
  • 相关阅读:
    Java I/O
    iOS AppsFlyer的使用注意事项
    Star Schema and Snowflake Schema
    SSB基准测试
    ES Route
    CPS(Cyber-Physical Systems)白皮书-摘选
    蓄电池放电容量与环境温度的关系
    时间序列分析(二)
    时间序列分析(一)
    IndexR
  • 原文地址:https://www.cnblogs.com/zph666/p/10463587.html
Copyright © 2011-2022 走看看