hexo忽略文件(skip_render)配置
使用antd
的Form
表单组件时,然后结合文档梳理一下规则使用的几种方式。
记录不同形式Destructuring导致的不同结果:
|
|
在使用ES6时,一般都是推荐使用let, const
来定义变量,相对var
而言:
Hoisting | Scope | Creates global properties | |
---|---|---|---|
var | Declaration | Function | Yes |
let | Temporal dead zone | Block | No |
const | Temporal dead zone | Block | No |
Temporal dead zone
这个与var
的Declaration
有什么不一样的地方?
如何向所有的客户端广播数据?
使用io.sockets.emit
|
|
使用socket.broadcast.emit
|
|
两种方式区别io.sockets.emit
向所有连接的客户端广播数据,而socket.broadcast.emit
则向
除了该socket
自身之外的其他所有广播数据。其实也就是说io.sockets.emit
= socket.broadcast.emit
+ socket.emit
因此可以猜测出socket.io内部会保留所有连接的socket。