随笔分类 -  js

前端啦啦啦啦
摘要:for里可以break。forEach不行 阅读全文
posted @ 2024-01-10 11:32 流星曳尾 阅读(6) 评论(0) 推荐(0)
摘要:如题 阅读全文
posted @ 2023-05-15 10:56 流星曳尾 阅读(17) 评论(0) 推荐(0)
摘要:let init = ["a","b","c"]; let arr = init.slice(0);//正确的克隆方式,修改其中一个另一个不会改 arr[arr.length] = 0; let arr2 = init ; //不可以直接=,这样其实用的是同一个数组,用同个引用地址,修改其中一个另一 阅读全文
posted @ 2021-09-06 15:27 流星曳尾 阅读(95) 评论(0) 推荐(0)
摘要://es5 interface JSON { /** * Converts a JavaScript Object Notation (JSON) string into an object. * @param text A valid JSON string. * @param reviver A 阅读全文
posted @ 2021-06-12 14:49 流星曳尾 阅读(460) 评论(0) 推荐(0)
摘要:字符串转化为其他parseInt() parseFloat()int,float转化为字符串 .toString() 阅读全文
posted @ 2020-07-10 17:00 流星曳尾 阅读(124) 评论(0) 推荐(0)
摘要:array.forEach(function(item,index){ }.bind(this)); 同 array.forEach((item,index) =>{ }); 阅读全文
posted @ 2019-08-22 10:43 流星曳尾 阅读(8890) 评论(0) 推荐(0)
摘要://arrayObject.splice(index,howmany,item1,.....,itemX) 语法 //测试代码let array;array = ['George','John','Thomas','James','Adrew','Martin'];cc.log('array = ' 阅读全文
posted @ 2019-08-15 14:16 流星曳尾 阅读(304) 评论(0) 推荐(0)
摘要://array.find(function(currentValue, index, arr),thisValue) 方法说明let tempArray = [ {"key":100,"key2":"sdfsdf"},{"key":210,"key2":"dfgdg"},{"key":310,"ke 阅读全文
posted @ 2019-08-15 11:23 流星曳尾 阅读(3468) 评论(0) 推荐(0)