Giter Site home page Giter Site logo

error's Introduction

ERROR

错题集

总结一下那些还能记得的面试题: 1.不用循环,不用数组的方法求一个数组中的最大值。 Math.max.apply(Math, arr);

2.apply和call的区别 JavaScript中的每一个Function对象都有一个apply()方法和一个call()方法 定义:调用一个对象的一个方法,用另一个对象替换当前对象 apply:最多只能有两个参数——新this对象和一个数组argArray。如果给该方法传递多个参数,则把参数都写进这个数组里面,当然,即使只有一个参数,也要写进数组里。如果argArray不是一个有效的数组或arguments对象,那么将导致一个TypeError。如果没有提供argArray和thisObj任何一个参数,那么Global对象将被用作thisObj,并且无法被传递任何参数。

call:它可以接受多个参数,第一个参数与apply一样,后面则是一串参数列表。这个方法主要用在js对象各方法相互调用的时候,使当前this实例指针保持一致,或者在特殊情况下需要改变this指针。如果没有提供thisObj参数,那么 Global 对象被用作thisObj。 

实际上,apply和call的功能是一样的,只是传入的参数列表形式不同。

3.闭包的作用 闭包就是能够读取其他函数内部的函数。 由于在Javascript语言中,只有函数内部的子函数才能读取局部变量,因此可以把闭包简单理解成"定义在一个函数内部的函数"。 所以,在本质上,闭包就是将函数内部和函数外部连接起来的一座桥梁。 闭包的用途:闭包可以用在许多地方。它的最大用处有两个,一个是前面提到的可以读取函数内部的变量,另一个就是让这些变量的值始终保持在内存中。

4.手写一个Promise函数 5.ES6的新知识有哪些 6.html5的新特性 7.编写一段代码,要求每隔1秒输出一个数字,数字从1递增到n 8.实现一个函数clone,可以对javascript中的5种主要的数据类型(包括Number、String、Object、Array、Boolean)进行值的复制 9.编写一个js函数,输入类选择器(无需兼容组合选择器)可以返回匹配的DOM节点 10.从输入url到返回页面的过程 11.请指出document load和document read的区别 12.判断一个字符串中出现最多的字符,统计这个次数 13.描述面向对象中继承实现的方法 14.编写一个数组去重的方法 15.vue双向绑定的原理 16.vue-router的钩子函数 17.vuex的状态 18.vue组件之前的通信 19.Ajax的实现原理 20.jsonp的实现原理 21.跨域通信的方式 22.同源策略 23.json有哪些结构(格式) 24.cookie的理解 25.优化方案 26.遇到的兼容问题

error's People

Contributors

xuxiaoyin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.