Git Product home page Git Product logo

today-i-learned's Introduction

today-I-learned

2021-01-12

inputmode

2020-03-30

Three ways to measure the performance of functions:

  • performance.now()
  • console.time(identifier) and console.timeEnd(identifier)
  • execute the function multiple times if it is running too fast.

2020-03-18

Scope is static and contains a fixed set of variables available at the moment and location you define a function, but a function's execution context is dynamic, entirely dependent on how it is called (regardless of where it is defined or even called from).

2020-02-13

DOMContentLoaded 事件是 DOMCSSOM 都构建完成后触发。

2020-02-11

CSS not only blocks rendering but also blocks script execution and that’s why optimizing CSS is so important.

css文件的加载不仅会 block render tree 的生成,也会 block script tag 的执行。

2020-01-27

c中,数组里的元素的内存地址是根据数组里的类型控制的,比如int nums[3],每个int都是int占4个bytenums[0]的内存地址是0x100,接下来的元素内存地址就是0x1040x108

2020-01-27

c中,定义一个string可以使用char *s来定义,s是一个指针指向第一个char的内存地址。

2019-12-25

In React 16 and earlier, only updates inside React event handlers are batched by default. There is an unstable API ReactDOM.unstable_batchedUpdates to force batching outside React event handlers.

多次 setState 不会立即重新调用 render 重新渲染,React 会 batch 然后只执行一次渲染,但是这只在 React event handlers 中表现(在 Promise.thensetTimeout 等中没有实现),因为 React event handlers 实际调用了 ReactDOM.unstable_batchedUpdates 这个方法来批量处理更新。

2019-12-22

rAF 是在下一次重绘之前调用,通常是一秒钟60次,与屏幕刷新率相同。如果刷新率更高,浏览器也会与之匹配。所以使用 rAF 绘制动画时,不能默认每一次间隔就是 1/60 sec。

2019-12-01

  • toLocaleString 可以传入 options 来修改日期格式。
new Date().toLocaleString('zh-cn', { weekday: 'long' })
// "星期日"
new Date().toLocaleString('zh-cn', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' })
// "2019年12月1日星期日"

2019-11-14

  • microtasks 并不一定是在当前 task 执行完,下一次 task 执行之前执行。在当前 task 执行中时,如果执行栈里没有其他待执行的 JavaScript,就会立即执行 microtasks。

Execution of a Job can be initiated only when there is no running execution context and the execution context stack is empty

today-i-learned's People

Contributors

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