記錄一些有意思的前端面試題
1、乘積函式
程式碼
function mul(){ let {slice}=Array.prototype; let argus=slice.call(arguments,0); let returnFn=function(){ let arguArr=slice.call(arguments,0); return mul.apply(null,arguArr.concat(argus)) } returnFn.valueOf=function(){ return argus.reduce(function(total,item){ return total*item }) } returnFn.toString=null return returnFn } alert(mul(3)(3,3)(4)) alert(mul(3,10,3))
2、一個表示式的結果
const result=++[[]][+[]]+[+[]];
console.log(result)//?
答案:‘10’
+[ ] => 0
[+[ ]] => [0]
[[]][0] => []
++[] => 1
1+[0] => ‘10’
相關推薦
記錄一些有意思的前端面試題
1、乘積函式 程式碼 function mul(){ let {slice}=Array.prototype; let argus=slice.call(arguments,0); let returnFn=function(){ let arguArr=slic
一些前端面試題(一)
1.你做過的頁面在那些瀏覽器測試過?它們的核心分別是什麼? IE(trident核心);Firefox(gecko核心);Safari(webkit核心);Opera(以前是presto核心,現在已經改用Google Chrome的Blink核心);Chrome(Blink核心,基於webkit,Googl
最近整理的一些前端面試題
兩個 rect 試題 是什麽 復制 rec 為什麽 服務端 strong 基礎: JS基本數據類型有哪些?復制數組有哪些方式?如何判斷一個值未定義或為空,常見應用場景是什麽?跨域請求服務端的返回值是什麽?簡述事件冒泡? CSS: 簡述flex-direction的作用CSS
給老鐵們一些前端面試題,關於HTML+CSS的
1、你做的頁面在哪些流覽器測試過?這些瀏覽器的核心分別是什麼? 2、每個 HTML 檔案裡開頭都有個很重要的東西,Doctype,知道這是幹什麼的嗎? 3、Quirks 模式是什麼?它和 Standards 模式有什麼區別 4、div+css 的佈局較 table 佈局有什
前端面試題(來自前端網http://www.qdfuns.com/notes/23515/c9163ddd620baac5dd23141d41982bb8.html)
設置 session hat eval 減少 還需要 height 狀態碼 一次 HTML&CSS 1. 常用那幾種瀏覽器測試?有哪些內核(Layout Engine)? (Q1)瀏覽器:IE,Chrome,FireFox,Safari,Opera。 (Q2)內核
前端面試題二(來自前端網http://www.qdfuns.com/notes/23515/fa8b1e788ac39b04108fc33e5b543c4a.html)
scrip border cal 搜索引擎 val 媒體 分配 error 不刷新 HTML&CSS 1.請描述一下 cookies,sessionStorage 和 localStorage 的區別? cookie是網站為了標示用戶身份而儲存在用戶本地終端(Cl
js操作符類型轉換大全(前端面試題之操作符)
ber 出錯 mas java http pos ted 一個數 類型轉換 操作符運算符,在前端的面試題目中經常出現,很多朋友在對其運算的時候經常出錯。說明對操作符運算還沒有完全理解,我前面的一篇文章,javascript雙等號引起的類型轉換,主要講解雙等號引起的類型轉換。
web前端面試題
案例 asc eva nbsp != radi XML vertica 意義 面試有幾點需註意 面試題目: 根據你的等級和職位變化,入門級到專家級:範圍↑、深度↑、方向↑。 題目類型: 技術視野、項目細節、理論知識題,算法題,開放性題,案例題。 進行追問:
web前端面試題系列:(二)
html name 價值 編程 oct rom repeat 清除 frame 1、列舉你工作中遇到的IE6 BUG,談談解決方案 a.雙倍邊距bug: 例如:當給父元素內第一個浮動元素設置margin-left或margin-right的時候,margin屬性會加倍,
最近面試前端面試題整理(css部分)
type list 定位 text -c padding 面試 lang vertical 對最近面試的面試題坐下總結: 一,css部分 1,html元素的垂直居中 答案: <div id="box"> <div> 測
2017前端面試題之Css篇(1)
margin 沒有 width ati clas 經驗 visible import tom 1 . CSS 屬性是否區分大小寫? 答:不區分。 HTML,CSS都對大小寫不敏感,但為了更好的可讀性和團隊協作一般都小寫,而在XHTML 中元素名稱和屬性是必須小寫的。
2017前端面試題之Html篇(1)
utf doctype clas 停止 要求 驅動 抓取 -c 顯示錯誤 1 . doctype(文檔類型) 的作用是什麽? 對文檔進行有效性驗證: 它告訴用戶代理和校驗器這個文檔是按照什麽DTD 寫的。這個動作是被動的, 每次頁面加載時,瀏覽器並不會下載DTD
2017前端面試題之Js篇(1)
load urn lis property eat hub bind tlist 方法的參數 1 . 請解釋事件代理 (event delegation) 當需要對很多元素添加事件的時,可以通過將事件添加到它們的父節點通過委托來觸發處理函數。其中利用到了瀏覽器的事件冒
web前端面試題整理(HTML篇)
pad 關閉 選擇 words vid onunload adding per end 1. h5的改進: 新元素畫布canvas: HTML5 <canvas>元素用於圖形的繪制,通過腳本 (通常是JavaScript)來完成音頻audio視頻vid
前端面試題 ----css篇
設定 nbu radi tab 根據 pointer position net 放置 1、css盒模型有哪些及區別content-box border-box padding-box IE盒子模型box-sizing:border-box;(怪異模式) W3C標準盒子模
WEB前端面試題 分別使用2個、3個、5個DIV畫出一個大的紅十字
plain rotate tle copyto XML order bar back tro [html] view plain copy <!DOCTYPE html> <!--兩個DIV--> <html>
前端面試題整理---JS基礎
move asto 小寫 ngs 應用 ron 地址 create bst 為了督促自己學習,整理了一下前端的面試題 JavaScript: JavaScript 中如何監測一個變量是String類型? typeof(obj)==="string"; typeo
Web前端面試題(四)
就會 對象 wii 出現 閉包 需要 一個 settime post 1、wiindow.onload和$(document).ready的區別 window.onload只能出現一次,$(document).ready能出現多次 window.onload需要等所有文件都
前端面試題:JS中的let和var的區別
blog ocs undefine define 規範 target {} 擁有 comment 最近很多前端的朋友去面試被問到let和var的區別,其實阮一峰老師的ES6中已經很詳細介紹了let的用法和var的區別。我簡單總結一下,以便各位以後面試中使用。 ES6 新增
2010年騰訊前端面試題學習(jquery,html,css部分)
man 文章 利用 沒有 網頁 但是 lan opp 原因 看了牛人寫的回憶文章,裏面有2010年騰訊的前端面試題,裏面涉及到不少基礎性的問題,js部分已學習,這是jquery,html和css部分,學習一下:) 原文地址:https://segmentfault.com/