![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
javaScript
YATBOTB-lHQ
Start With Your Impossible
展开
-
JS - 正则表达式匹配必须包含数字、字母和下划线的字符串(强密码)
var re= /(?=.*[A-Za-z])(?=.*[\d])(?=.*_)/;原创 2020-05-26 15:35:29 · 3045 阅读 · 0 评论 -
JS 数据类型 真假
var bool = true;alert(!bool) //false 所以true 为true ;var bool = 0;alert(!bool) // true 所以0 是表示 false var bool = -1;alert(!bool) // false 所以-1 是表示 true var bool = "";alert(!bool...原创 2020-05-08 09:46:57 · 552 阅读 · 0 评论 -
js使用索引操作多维数组
多维数组理解成是一个 数组中的数组。当使用中括号[]去访问数组的时候,第一个[index]访问的是该数组中的第N个子数组,第二个[index]访问的是第N个子数组的第N个元素。(index为索引值从0开始)例如:var arr = [ [1,2,3], [4,5,6], [7,8,9], [[10,11,12],13,14]];console.log...原创 2018-08-17 23:41:28 · 2851 阅读 · 1 评论 -
ES5数组的迭代方法 map( )
map( )方法将调用的数组里的每一个元素传递给指定的函数,并且返回一个数组,它包含该函数的返回值;例如:var arr=[11,2,3,4,5];arr.map(function(elem,index){ console.log(elem) // 11,2,3,4,5 console.log(index) //0,1,2,3,4})//elem:第一...原创 2018-08-18 22:17:27 · 387 阅读 · 0 评论