You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
744 B
744 B
ECMAScript
基本语法
语句:
var num = 1;
引入文件:
- 直接写
- 引入本地文件
- 引入网络来源
数据类型
- 数值
- 字符串
- 布尔
- null
- 对象
- undefined
特别的 对象:
var user{
age: 18,
name: 'sss',
}
运算符
typeof
console.log(typeof age);
三元/目运算符
num % 2 === 0 ? console.log("偶数") : console.log("奇数");
字符串
json
对象转为字符串 JSON.stringify(obj)
BOM
浏览器对象模型
DOM
文档对象模型 将html中所有元素都封装成一个对象,采用面向对象的方式,来对HTML进行操作