CentOS 6.5下Squid代理服务器的安装与配置
2015-08-12 11:41
507 查看
switch 语句
[b] switch(typeof x) {
case 'number': // Convert the number to a hexadecimal integer
return x.toString(16);
case 'string': // Return the string enclosed in quotes
return '"' + x + '"';
case 'boolean': // Convert to TRUE or FALSE, in uppercase
return x.toString( ).toUpperCase( );
default: // Convert any other type in the usual way
return x.toString( )
}
case 关键字后跟随的一般是 数字和字符串常量,也可以跟表达式,但是会产生不可思议的副作用,所以不提倡用expression。
[b]for/in 语句
语法如下:
for (variable in object)
statement
variable should be either the name of a variable(应该是一个变量名), a var statement declaring a variable, an element of an array, or a property of an object 。
object is the name of an object or an expression that evaluates to an object 。
The for/in statement provides a way to loop through the properties of an object. The body of the for/in loop is executed once for each property of object. Before the body of the loop is executed, the name of one of the object's properties is assigned to variable, as a string. Within the body of the loop, you can use this variable to look up the value of the object's property with the [] operator
for (var prop in my_object) {
document.write("name: " + prop + "; value: " + my_object[prop], "<br>");
}
Note that the variable in the for/in loop may be an arbitrary expression, as long as it evaluates to something suitable for the left side of an assignment. This expression is evaluated each time through the loop, which means that it may evaluate differently each time. For example, you can use code like the following to copy the names of all object properties into an array:(通过下面的代码,把一个对象的所有属性名复制到一个数组中)
var o = {x:1, y:2, z:3};
var a = new Array( );
var i = 0;
for(a[i++] in o) /* empty loop body */;
注意 对象引用属性的方法 既可以通过 o.x,也可以通过这种方式:o["x"]
[b]break 语句
break 语句会使程序立即跳出最内层的循环或switch语句,语法为 break;
break 后还可以跟一个标签名: break labelname;
对break 语句中的标签中的唯一限制就是他命名的是一个封闭的语句。
[b]
[b] switch(typeof x) {
case 'number': // Convert the number to a hexadecimal integer
return x.toString(16);
case 'string': // Return the string enclosed in quotes
return '"' + x + '"';
case 'boolean': // Convert to TRUE or FALSE, in uppercase
return x.toString( ).toUpperCase( );
default: // Convert any other type in the usual way
return x.toString( )
}
case 关键字后跟随的一般是 数字和字符串常量,也可以跟表达式,但是会产生不可思议的副作用,所以不提倡用expression。
[b]for/in 语句
语法如下:
for (variable in object)
statement
variable should be either the name of a variable(应该是一个变量名), a var statement declaring a variable, an element of an array, or a property of an object 。
object is the name of an object or an expression that evaluates to an object 。
The for/in statement provides a way to loop through the properties of an object. The body of the for/in loop is executed once for each property of object. Before the body of the loop is executed, the name of one of the object's properties is assigned to variable, as a string. Within the body of the loop, you can use this variable to look up the value of the object's property with the [] operator
for (var prop in my_object) {
document.write("name: " + prop + "; value: " + my_object[prop], "<br>");
}
Note that the variable in the for/in loop may be an arbitrary expression, as long as it evaluates to something suitable for the left side of an assignment. This expression is evaluated each time through the loop, which means that it may evaluate differently each time. For example, you can use code like the following to copy the names of all object properties into an array:(通过下面的代码,把一个对象的所有属性名复制到一个数组中)
var o = {x:1, y:2, z:3};
var a = new Array( );
var i = 0;
for(a[i++] in o) /* empty loop body */;
注意 对象引用属性的方法 既可以通过 o.x,也可以通过这种方式:o["x"]
[b]break 语句
break 语句会使程序立即跳出最内层的循环或switch语句,语法为 break;
break 后还可以跟一个标签名: break labelname;
对break 语句中的标签中的唯一限制就是他命名的是一个封闭的语句。
outerloop: |
相关文章推荐
- squid 重定向器
- Apache配置正向代理与反向代理
- Nginx反向代理的配置
- Nginx多Server反向代理配置
- 【二十】关于利用squidclient分析日志未命中情况寻求优化
- 使用Nginx反向代理实现负载均衡
- 使用Haproxy,Keepalived,Tproxy实现高可用透明反向代理
- 关于大型网站技术演进的思考(十八)--网站静态化处理—反向代理(10) 【架构师的想法:正向代理和反向代理的区别】
- sarg对squid的日志流量分析报表(按小时,天,周生成)
- 使用CentOS7配置Squid代理
- Nginx反向代理tomcat
- 一次域名备案被注销后无法访问80和8080端口的转移过程
- 双nginx(主备、主主)反向代理tomcat实现web端负载均衡
- windows 下nginx反向代理出现 upstream time out的问题
- nginx 作为反向代理实现负载均衡的例子
- 正向代理与反向代理的区别【Nginx读书笔记】
- 反向代理
- 【十七】关于ACL、Squid等。
- 正向代理与反向代理
- tornado 反向代理后 获取真实客户端IP