1判斷數(shù)組的方法:
? ? ? ? 1.arr instanceof Array
? ? ? ? 2.arr.constructor == Array
? ? ? ? ? ? ? ? ? ?????????3.Object.prototype.toString.call(ob????????????????j) === '[object Array]'
????????4.Array.isArray(arr)
2.Object.create()
? ??????方法創(chuàng)建一個新對象,使用現(xiàn)有的對象來提供新創(chuàng)建的對象的proto。
3. let const var 區(qū)別
? ? ? ? let作用域是塊級作用域、不存在變量提升、不能重復(fù)定義、存在暫時性死區(qū)
? ? ? ? const的聲明的變量不允許改變
4.基本類型: String Number Boolean Null Undefined? 棧內(nèi)存保存簡單數(shù)據(jù)段
? ? 引用類型: 對象、數(shù)組、函數(shù)、正則? ?保存在堆內(nèi)存的??
5. call\apply\bind實現(xiàn)
? ? Function.prototype.newCall = function(context, ...arr) {
? ? ? ? ? ? if (typeof context === 'object') {
? ? ? ? ? ? ? ? ? ? context = context || window;
? ? ? ? ? ? } else {
? ? ? ? ? ? ? ? ? ? context = Object.create(null)
? ? ? ? ? ? }
? ? ? ? ? ? let fn =Symbol();
? ? ? ? ? ? context[fn] = this;
? ? ? ? ? ? context[fn] (...arr);
? ? ? ? ? ? delete context[fn];
? ? ? ? }
Function.prototype.newBind = function (context, ...innerArgs) {
? ? var me = this;
? ? return function (...finnalArgs) {
? ? ? ? return me.call(context, ...innerArgs, ...finnalArgs)
? ? }???
}
?6.? 介紹事件循環(huán)
? ??????(macro)task 主要包含:script( 整體代碼)、setTimeout、setInterval、I/O、UI 交互事件、setImmediate(Node.js 環(huán)境)
microtask主要包含:Promise、MutaionObserver、process.nextTick(Node.js 環(huán)境)
7.定時器不準(zhǔn)原因: eventloop循環(huán)機制中,異步事件set interval到時回把回調(diào)函數(shù)放入消息隊列,主線程的任務(wù)執(zhí)行完畢后,依次執(zhí)行消息隊列的任務(wù),由于消息隊列中存在大量任務(wù),其他任務(wù)執(zhí)行時間就會造成定時器回調(diào)函數(shù)的延遲,如果不處理會一直疊加延遲
? ? ? ? 使用web Work
? ? ? ? ? ? ? ? let work = new Work()
8.原型介紹
? ? ? ? 原型就是一個屬性,這個屬性是構(gòu)造函數(shù)的屬性,后面所有的對象都會繼承原型的屬性與方法.

9.繼承方法:?
? ? 1.原型鏈繼承:
? ? ? ? ? ? Cat.prototype = new Animal();
? ? 2.構(gòu)造繼承:
? ? ? ? ? ? function? Cat() { Animal.call(this);}
? ? 3.實例繼承
? ? ? ? ? ? function Cat() { var instance = new Animal(); return instance }
? ? 4.拷貝繼承????????
? ? 5.組合繼承
? ? ? ? ?function Cat() {? Animal.call(this)? }
? ? ? ? ?Cat.prototype = new Animal();
? ? ? ? ?Cat.prototype.constructor = Cat;
? ? 6.es6的extends繼承
? ? ? ? ? ? class Chinese extends Person {
? ? ? ? ? ? ? ? ? ? constructor() {
? ? ? ? ? ? ? ? ? ? ? ? ? ? super()
? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? 7.閉包的介紹和它的作用:
? ? ? ? ? ? ? ? 閉包就是能夠讀取其他函數(shù)內(nèi)部變量的函數(shù).
? ? ? ? ? ? ? ? ? ? ?可以讀取函數(shù)內(nèi)部的變量;讓這些變量的值始終保存在內(nèi)存中
? ? ? ? 8.new的實現(xiàn)過程
? ? ? ? ? ? ? ? 1.創(chuàng)建了一個空對象,將它的引用賦給this,繼承函數(shù)的原型;
? ? ? ? ? ? ? ? 2.通過this將屬性和方法添加至這個對象
? ? ? ? ? ? ? ? 3.最后返回this指向新對象,也就是實例