我是靠谱客的博主 清脆曲奇,这篇文章主要介绍JS//对象JS——对象,现在分享给大家,希望可以做个参考。

在这里插入图片描述

JS——对象

数组、对象的API

1 JS Array

  • 属性
复制代码
1
2
constructor、length、prototype
  • 方法
复制代码
1
2
3
4
5
6
7
8
9
10
11
增 —— (push、unshift)(join、concat) 删 —— (pop、shift、splice) 改 —— (reverse、copyWithin、fill)(toLocaleString、toString) 查 —— (indexOf、lastIndexOf、includes、sort)(slice) 迭代 —— (forEach、every 、some、 fliter、map、 reduce、reduceRight、 find、findIndex、 keys、values、entries) 判断 —— (isArray)

2 JS Boolean

  • 属性
复制代码
1
2
constructor、prototype
  • 方法
复制代码
1
2
改 —— toString

3 JS Date

  • 属性
复制代码
1
2
constructor、prototype
  • 方法
复制代码
1
2
3
4
5
6
7
8
9
改 —— setFullYear、setMonth、setDate(1-31)、setDay setHours、setMinutes、setMilliseconds、setSeconds setTime(1970.1.1至今的毫秒数) 查 —— getFullYear、getMonth、getDate(1-31)、getDay getHours、getMinutes、getMilliseconds、getSeconds getTime(1970.1.1至今的毫秒数)

4 JS Math

  • 方法
复制代码
1
2
3
查 —— (ceil、floor、max、min、random、round) 【Math.max(x,y,z,...,n)

5 JS Number

  • 属性
复制代码
1
2
3
constructor、prototype、 MAX_VALUEMIN_VALUENEGATIVE_INFINITYNaNPOSITIVE_INFINITY
  • 方法
复制代码
1
2
3
4
5
6
7
8
判断 —— isFinite 是否无穷大 isInteger 是否为整数 改 —— toFixed(x) 把数字转换为字符串,结果的小数点后有指定位数的数字。 toPrecision(x) 把数字格式化为指定的长度。 toString() 把数字转换为字符串,使用指定的基数。

6 JS String

  • 属性
复制代码
1
2
constructor、prototype、length
  • 对象方法
复制代码
1
2
3
4
5
6
7
8
9
10
增 —— (concat、repeat) 删 —— (splice、trim) 改 —— (replace、split、toLowerCase、toUpperCase) 查 —— chatAt、slice // 返回指定位置的字符 indexOf、lastIndexOf、search //返回string对象起始位置,没有则-1 includes、startsWith、endsWith、match substr (start, length) substring (from, to)

————————————————

7 JS RegExp

  • 修饰符
  • 方括号
  • 元字符
  • 量词
  • RegExp 对象方法
  • 支持正则表达式的String对象的方法
  • RegExp 对象属性

8 JS Functions

  • 全局属性
复制代码
1
2
InfinityNaN、undefined
  • 方法
复制代码
1
2
3
4
isFinite、isNaN、 Number、String //把对象转化为数组or字符串 parseFloat、parseInt //解析字符串为浮点数or整数

————————————————

9 JS 运算符

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
* 算术运算符 + - * / % ++ -- * 赋值运算符 = += -= *= /= %= * 字符串运算符 + += * 比较运算符 == === != !== > < >= <= * 条件运算符(三目运算符) 变量 =(条件)?值1:值2 * 逻辑运算符 && ||* 位运算符 & | ~ ^ << >>

10 JS Events

  • 事件句柄
复制代码
1
2
3
4
5
6
onblur、onfocus、onselect onabort、onerror、onchange、onload、onunload onreset、onresize、onsubmit onclick、ondbclick、onmousedown、onmouseup、onmousemove、onmouseover onkeydown、onkeypress

最后

以上就是清脆曲奇最近收集整理的关于JS//对象JS——对象的全部内容,更多相关JS//对象JS——对象内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(80)

评论列表共有 0 条评论

立即
投稿
返回
顶部