1.javascript的四种显示方案
window.alert();
document.write();
document.innelHTML();
console.log();
2.javascript命令不能使用连字符(‘-’),它是为减法预留的
3.重复声明变量值,该值不丢失
var a=10;
var a;
console.log(a) //输出10,不是undefined;
4.数值+字符串,结果为字符串
5.javascript位运算符处理的数字是32位的
var a = ~5; //5 = 0101B,若位运算为4位,则~5=1010B,即10D
console.log(a) //结果是-6,不是10
6.幂运算符号为“**”,等同于Math.pow(a,b)
即2**3等价于Math.pow(2,3),返回值为8;
7.
var x= 56+4+"lmz",
console.log(x) //输出值为60lmz,即运算由左往右。
8.javascript的数据类型
字符串值,数值,布尔值,数组,对象
9.javascript具有动态数据类型,即变量的类型可以变换。
10.在javascript中,数组属于对象
11.任何变量都可以使用undefined清空
12.NULL ,空值,undefined的对比
NULL值不存在,类型为object
空值的值为“”,类型为string
undefined 值为undefined,类型为undefined
13.可以使用NULL清空对象
14.
NULL === undefined // false
NULL == undefined //true