Comments (10)
-
好的代码编辑图片网站:https://carbon.now.sh/
-
看了React源码
-
记得后台管理有缓存问题,去查明原因吧 小火汁
-
解说react好的网站:https://www.yanshuo.me/p/67112
from fe-knowledge.
- 判断一个值是否是NaN,标准的库函数isNaN也不可靠
比如:
isNaN(NaN); // true
isNaN(undefined); // true
isNaN({}); // true
- 可以通过下面的函数进行判断
function isReallyNaN(x){
return x !== x;
}
- GET规范模板,有关issues,commit,以及 心路历程。 commit方面个人还是比较喜欢加上emoji 【链接:https://gitmoji.carloscuesta.me/】
from fe-knowledge.
- 理解JavaScript的浮点数
0.1 + 0.2; // 0.30000000000000004
(0.1 + 0.2) + 0.3; // 0.6000000000000001
0.1 + (0.2 + 0.3); // 0.6
所以平时尽可能地采用整数值运算
from fe-knowledge.
- 判断奇偶数可以通过 &(按位与)
- 比如:
12 & 1 // 0
23 & 1 // 1
【常用于if语句】,这种写法可读性不高
from fe-knowledge.
- 有时看到另一种 bind 函数的方法
this.foo = ::this.foo;
- 等同于下面的语句👇
this.foo = this.foo.bind(this);
【两个冒号的::操作符叫做 bind 操作符】
from fe-knowledge.
Erlang 语言的作者 Joe Armstrong 说,面向对象语言的问题是,它们永远都要随身携带那些隐式的环境。你只需要一个香蕉,但却得到一个拿着香蕉的大猩猩...以及整个丛林
from fe-knowledge.
React源码中 $$typeof
有什么作用?
- 所有的 React elements 需要加上
$$typeof: Symbol.for(‘react.element’)
用来解决安全问题。防止 XSS 注入,采用 symbol 方式,在判断是否合法的 element 时,检查$$typeof
属性
from fe-knowledge.
React源码中,为什么会用 0xeac7
?
// The Symbol used to tag the ReactElement type. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var TYPE_SYMBOL = (typeof Symbol === 'function' && Symbol.for &&
Symbol.for('react.element')) || 0xeac7;
- 因为看起来像
React
😆 参考链接
from fe-knowledge.
from fe-knowledge.
正确答案:
script start
async1 start
async2
promise1
script end
async1 end
promise2
undefined
setTimeout
from fe-knowledge.
Related Issues (7)
- Webpack和按需加载 HOT 3
- 正向代理与反向代理的区别 HOT 2
- React的生命周期理解 HOT 1
- Git流程 HOT 2
- Commit Message Emoji HOT 2
- 扑克牌问题
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fe-knowledge.