随笔分类 -  web 前端 / JavaScript

摘要:1.split // split(separator, limit) separator为分隔符;limit为已经有 limit 个元素时停止分割 const str = 'The quick brown fox jumps over the lazy dog.'; const words = st 阅读全文
posted @ 2024-01-08 17:39 两块五的菜鸟 阅读(3) 评论(0) 推荐(0) 编辑
摘要:1.indexOf() // indexOf(searchElement(要查询的元素), fromIndex(起始位置)) let uint8 = new Uint8Array([2, 5, 9]); uint8.indexOf(2); // 0 2.forEach() // forEach(ca 阅读全文
posted @ 2024-01-05 13:51 两块五的菜鸟 阅读(5) 评论(0) 推荐(0) 编辑
摘要:函数 函数声明 function sayHello(){ return "Hello JavaScript!!" } 函数表达式 let sayHello = function() { return "Hello JavaScript!!" } 函数、变量提升: 函数和变量都会被提升,且函数会被优先 阅读全文
posted @ 2023-12-28 16:16 两块五的菜鸟 阅读(22) 评论(0) 推荐(0) 编辑
摘要:1. oberable error处理的unit test 当正常的subscribe处理完成之后,在同一个it测试集里再重新构造函数: 构造新的error值: //注意import import { Observable, of } from "rxjs"; let errorConfig = n 阅读全文
posted @ 2021-11-16 10:08 两块五的菜鸟 阅读(82) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示