一些前端筆試總結

2021-07-23 01:20:05 字數 1067 閱讀 9823

1. 迴圈繫結事件

解決方案:

第一種第二種

2. bind函式的原生js實現    

參考

function.prototype.bind = function (othis) 

var aargs = array.prototype.slice.call(arguments, 1),

ftobind = this,

fnop = function () {},

fbound = function () ;

fnop.prototype = this.prototype;

fbound.prototype = new fnop();

return fbound;

};

3. 表單有哪些相關標籤

form, input, label, select, option, textarea, fieldset, legend, optgroup, button

4. 乙個陣列['a','a','b','b','b','c','c','c','c'],寫乙個通用函式,輸出其中數量最多的元素名稱及次數

function arr_max(arr)];

// 設定乙個變數,始終指向result中正在處理的物件

var index=0;

// 遍歷目標陣列

for(var i=0, arr_len=arr.length; i5. 兩列布局,左邊固定320px,右邊自適應

6. http在狀態碼為302時,會產生兩次http請求。

301,302 都是http狀態的編碼,都代表著某個url發生了轉移,不同之處在於:

301 redirect: 301 代表永久性轉移(permanently moved)。

302 redirect: 302 代表暫時性轉移(temporarily moved )。302轉向可能會有url規範化及**劫持的問題。可能被搜尋引擎判為可疑轉向,甚至認為是作弊。

web前端一些總結

一 文字框設定為圓角後獲得焦點又變為方角的解決方法 css outline none 二 html5的一些文字特性 required required aria required true autofocus autofocus required required aria required tru...

前端一些易錯題總結

const 可以先宣告後賦值麼?const a 答 不可以,會報錯uncaught syntaxerror missing initializer in const declaration let 可以先使用後宣告麼?console.log a let a 12 答 不可以,uncaught ref...

一些筆試題

int main int argc,char argv int multi int a,int b,int c typedef int func1 int in typedef int func2 int int int 013.請寫出下列 的輸出內容 include stdio.h main 解 ...