摘要: # 1. charAt(): 返回在指定位置的字符# charCodeAt(): 返回在指定的位置的字符的 Unicode 编码let str = "Hello World";console.log(str.charAt(6); // Wconsole.log(str.charCodeAt(6)); 阅读全文
posted @ 2021-06-21 16:27 钱途似锦 阅读(83) 评论(0) 推荐(0)
摘要: # 1. every(): 检测数组所有元素是否都符合指定条件,一个不满足返回false(且剩余的元素不会再进行检测),否则返回true, # some(): 只要有一个满足就返回true(剩余的元素不会再执行检测),都不满足返回false const arr = [10, 15, 16, 14, 阅读全文
posted @ 2021-05-11 17:18 钱途似锦 阅读(59) 评论(0) 推荐(0)
摘要: 当里面有错误时不抛出错误,而且运行catch里面的语句,try里面错误语句的后续代码不再运行,但是不影响后续代码运行 try { alertt("111111111") } catch(error) { // 打印出错误类型和错误信息 console.log(error.name + " :" + 阅读全文
posted @ 2021-05-11 15:03 钱途似锦 阅读(92) 评论(0) 推荐(0)