Math工具函数
1:Math.PI
2:Math.random 返回 [0, 1)范围的数;
3:Math.floor(); 向下取整数;
4:Math.sin, Math.cos, Math.tan 三角函数
5: 角度转弧度,弧度转角度;
0-360是度 0-2*PI 是弧度 一个圆是 2*PI 1*PI大概是3.141592653589793
6: 反三角函数Math.asin, Math.acos, Math.atan;
7: Math.atan2(y, x), 返回一个坐标(y, x)对应的角度;(-PI, PI];
8: Math.sqrt 开根号;
数组的高级使用
1:array.length; 获取数组的长度;
2:遍历一个数组; for(var key in array);
俩种方法
3: 向数组末尾加入一个元素; push
4: 查找对象在数组中所对应的索引; indexOf()
5: 删除数组的某个元素; splice(开始索引,要删除的个数)
6: 数组的排序;
7: 随机 打乱一个数列;
8:随机的从一堆的数据里面抽取一个值;
表的高级使用
属于模块类,下一篇详细讲解
1:遍历一个表; for(key values in table)
2: 删除表中的数据; delete list_data[4];
字符串对象高级使用
1:str.length;属性
2: str.indexOf();返回子串首次出现的位置;
3:str.replace(/Microsoft/,"W3School");
4:toLowerCase, toUpperCase;