Coder Social home page Coder Social logo

fe-base's Introduction

前端基础知识整理及回顾

##时间机制

事件触发三阶段

  • window 往事件触发处传播,遇到注册的捕获事件会触发
  • 传播到事件触发时触发注册的事件
  • 从事件触发处往 window 传播,遇到注册的冒泡事件会触发

执行上下文

JS代码执行会产生三种执行上下文

  • 全局执行上下文
  • 函数执行上下文
  • eval 执行上下文

每个上下文都有三个重要的属性:

  • 变量对象,包含变量,函数声明和函数形参,只能在全局上下文中访问
  • 作用域链(JS采用词法作用域,变量的作用域在定义时就决定了)
  • this

深浅拷贝

深拷贝

JSON.parse(JSON.stringify(object))的局限:

  • 会忽略 undefined
  • 会忽略 symbol
  • 不能序列化函数
  • 不能解决循环引用的对象

浏览器渲染机制

  1. 处理 HTML 并构建 DOM 树
  2. 处理 CSS 构建 CSSDOM 树
  3. 将 DOM 与 CSSDOM 合并成一个渲染树(会阻塞渲染)
  4. 根据渲染树布局,计算每个节点的位置
  5. 调用 GPU 绘制,合成图层,显示在屏幕上

fe-base's People

Contributors

handsomepear 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.