Notes
  • 速记
  • 前端面试
  • HTML / CSS
    • HTML
    • CSS
    • CSS Modules
      • CSS Modules
        • CSS Modules Usage
      • Stylus
      • Nunjucks
  • Javascript
    • 正则表达式
    • 代理(Proxy)和反射(Reflection)
    • 类型转换
    • 按位操作
    • 数据可视化
    • 数据采集
      • 无(全)埋点
      • 模块曝光事件
    • package
      • axios
    • Event Loop
    • React
      • React热身
      • VDOM和DOM-diff
    • Vue
    • Omi
    • MVVM
    • 百度小程序
    • AST抽象语法树
    • ServiceWorker
    • WebSocket
  • NodeJS
    • Assert 断言
    • chai.js 断言库
    • Node Global Obj And Var
    • CLI Writed By Nodejs
    • Framework
      • Hapi Js Framework
    • Electrode JS
      • Electrode Platform
      • Electrode Question
    • Redux
      • Redux Basic Usage
      • Middleware And Asynchronous
      • React-Redux 的用法
    • NPM
      • package.json
      • semver
    • Webpack
      • 编写插件
    • 同构渲染
    • 调用DLL
  • 服务端
    • Inotify
    • Linux
    • Nginx
      • Nginx简介
      • Nginx原理、安装预配置
    • TCP/IP 协议
    • HTTP 协议
      • 基础概念篇
      • 协议详解篇
    • Process
      • 阻塞与非阻塞
      • 进程与线程优性能
  • 数据库
    • GraphQL
  • 移动端
  • 微信小程序
    • 微信小程序安装(linux)
    • 小程序第三方框架
  • 开发工具
    • 开发工具安装
    • Vim Command Collection
    • Git
      • Git Rule
      • Git Submodule
      • gitignore
    • Lerna
    • Ubuntu开发环境安装
  • 运维测试
    • Docker
      • Docker Synopsis
      • docker.sock
    • Nightwatch
    • Jest
  • 算法/数学/架构
    • 设计模式
    • 架构设计经验分享
    • 前端架构
    • 基本数据结构
    • 函数式编程
  • 软件工程
    • 软件生命周期
Powered by GitBook
On this page
  • TODO
  • DOCS
  • ES Modules
  • git commit format
  • getBoundingClientRect
  • dispatchEvent
  • JS滚轮事件(mousewheel/DOMMouseScroll)
  • 兼容差异
  • 渲染10k条记录
  • window.requestIdleCallback()

Was this helpful?

速记

Next前端面试

Last updated 5 years ago

Was this helpful?

TODO

  1. [按位操作

  2. graphql

DOCS

ES Modules

ES Modules 是用来处理模块的 ECMAScript 标准 当Node.js多年来一直使用 CommonJS 标准时,但浏览器从未拥有模块系统,因为每个主要决策(例如模块系统)都必须先由ECMAScript标准化,然后由浏览器实现

git commit format

<type>(<scope>): <subject>
// 空一行
<body>

//type(必需)、scope(可选)和subject(必需)
//<body>(可选)
  • type用于说明 commit 的类别,只允许使用下面8个标识。

  • br: 此项特别针对bug号,用于向测试反馈bug列表的bug修改情况

  • feat:新功能(feature)

  • fix:修补bug

  • docs:文档(documentation)

  • style: 格式(不影响代码运行的变动)

  • refactor:重构(即不是新增功能,也不是修改bug的代码变动)

  • test:增加测试

  • chore:构建过程或辅助工具的变动

  • revert: feat(pencil): add 'graphiteWidth' option (撤销之前的commit)

getBoundingClientRect

dispatchEvent

创建(createEvent)-初始(init*Event)-分派(dispatchEvent)

JS滚轮事件(mousewheel/DOMMouseScroll)

兼容差异

  1. onmousewheel(Other) / DOMMouseScroll(FF)

    包括IE6在内的浏览器是使用onmousewheel,而FireFox浏览器一个人使用DOMMouseScroll. 经自己测试,即使现在FireFox 19下,也是不识onmousewheel

  2. event.wheelDelta(Other) / event.detail(FF)

需要注意的是,FireFox浏览器的方向判断的数值的正负与其他浏览器是相反的。FireFox浏览器向下滚动是正值,而其他浏览器是负值。

渲染10k条记录

  • Large number of DOM nodes make rendering slow

  • JavaScript arrays can handle large data sets

  • Looping through large arrays is fast

  • Sorting arrays by providing custom function to Array.sort() is fast

  • eval() is slow, should not be used in large loops

  • To achieve smooth scrolling render a few hidden records on top and bottom outside of the visible area

window.requestIdleCallback()

会在浏览器空闲时期依次调用函数, 这就可以让开发者在主事件循环中执行后台或低优先级的任务,而且不会对像动画和用户交互这样延迟敏感的事件产生影响。函数一般会按先进先调用的顺序执行,然而,如果回调函数指定了执行超时时间timeout,则有可能为了在超时前执行函数而打乱执行顺序

var handle = window.requestIdleCallback(callback[, options])

window.cancelIdleCallback(handle)
Jest
benchmark
semantic-release