javascript学习贴(1)

学习自W3School(英文版):http://www.w3schools.com/js/js_statements.asp

"It is normal to add a semicolon at the end of each executable statement. ........

The semicolon is optional (according to the JavaScript standard), and the browser is supposed to interpret the end of the line as the end of the statement. Because of this you will often see examples without the semicolon at the end...........

Using semicolons makes it possible to write multiple statements on one line"

经常会在javascript的每条语句后面加上分号,但是分号是可选的,默认情况下浏览器会自动将一行的结束当成是一个语句的结束;分号可以使得一行中有多个语句。



javascript comments:

"Single line comments start with //"

"Multi line comments start with /* and end with */."


JavaScript Variables

"Variable names are case sensitive (y and Y are two different variables"
变量名大小写敏感
“Variable names must begin with a letter, the $ character, or the underscore character”
变量名的开头必为字母、$符、_
"You declare JavaScript variables with the var keyword:"
变量的声明或定义必须一var关键字开头

变量有局部和全局之分

“If you assign values to variables that have not yet been declared, the variables will automatically be declared as global variables.”
对未声明的变量赋值,该变量会自动转变为全局变量(作用域就是赋值处开始到文件结尾)

Comparison Operators


特别的
"=="和
"===":==是值等于,===是值和类型的相等


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值