Latest

ES6 块级作用域

ES6

ES6 块级作用域

var 变量提升 * 全局作用域下自动转换为window对象属性,而let、const不会。 function test1() { console.log(a) // undefined if(false) { var a = 1; } console.log(a) // undefined function inner() { if(false) { var b = 2 } } console.log(b); //RefrenceError b is not defined } 示例:http://jsbin.com/tunonipare/edit?html,js,console let 块级作用域 * 可以读取外层变量、可以重新定义外层变量,但是不能在块级作用域内重新声明函数如果必须要使用函数表达式声明。块级作用域声明函数必须在大括号内。

By Lewis
Nginx 代理设置

Nginx

Nginx 代理设置

HTTP基础功能: * 处理静态文件,索引文件以及自动索引; * 反向代理加速(无缓存),简单的负载均衡和容错; * FastCGI,简单的负载均衡和容错; * 模块化的结构。过滤器包括gzipping, byte ranges, chunked responses, 以及 SSI-filter 。在SSI过滤器中,到同一个 proxy 或者 FastCGI 的多个子请求并发处理; * SSL 和 TLS SNI 支持; * 重新配置和在线升级而无须中断客户的工作进程; 代理设置 ngnix.conf worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; include /etc/reverse-proxy.conf;

By Lewis