JS//对象

在这里插入图片描述

JS——对象

数组、对象的API

1 JS Array

  • 属性
constructor、length、prototype
  • 方法
增 —— (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

  • 属性
constructor、prototype
  • 方法
改 —— toString

3 JS Date

  • 属性
constructor、prototype
  • 方法
改 —— 
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

  • 方法
查 —— (ceil、floor、max、min、random、round)
【Math.max(x,y,z,...,n)

5 JS Number

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

6 JS String

  • 属性
constructor、prototype、length
  • 对象方法
增 —— (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

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

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

9 JS 运算符

* 算术运算符 
+    -    *    /    %
++    --

* 赋值运算符 
=    +=    -=    *=    /=    %=

* 字符串运算符 
+    +=

* 比较运算符 
==    ===    !=    !==
>    <    >=    <=

* 条件运算符(三目运算符)
变量 =(条件)?值1:值2

* 逻辑运算符 
&&    ||* 位运算符 
&    |    ~    ^    <<    >>

10 JS Events

  • 事件句柄
onblur、onfocus、onselect
onabort、onerror、onchange、onload、onunload
onreset、onresize、onsubmit
onclick、ondbclick、onmousedown、onmouseup、onmousemove、onmouseover
onkeydown、onkeypress
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值