随笔分类 -  ts

摘要:ES6 教程 - JavaScript 教程 ES6 类 之前 function Person(name) { this.name = name; } Person.prototype.getName = function () { return this.name; }; var john = n 阅读全文
posted @ 2025-04-22 15:44 流星曳尾 阅读(8) 评论(0) 推荐(0)
摘要:method是类里的。Function是独立的 阅读全文
posted @ 2025-03-14 14:45 流星曳尾 阅读(4) 评论(0) 推荐(0)
摘要:/** * Returns the index of the first occurrence of a value in an array, or -1 if it is not present. * @param searchElement The value to locate in the 阅读全文
posted @ 2024-12-18 15:07 流星曳尾 阅读(17) 评论(0) 推荐(0)
摘要:fangFa([a, b]){ } this.fangFa([1,2]); 阅读全文
posted @ 2024-11-29 16:52 流星曳尾 阅读(20) 评论(0) 推荐(0)
摘要:try{ } catch (e) { cc.error(e.message); } 能catch到异常,但还是卡死,感觉没啥用。而且catch不到异步代码里的异常 阅读全文
posted @ 2024-11-28 17:10 流星曳尾 阅读(23) 评论(0) 推荐(0)
摘要:直接写变量名,加enter。自动补全this 阅读全文
posted @ 2024-11-25 19:28 流星曳尾 阅读(11) 评论(0) 推荐(0)
摘要:数组 let a = [1,2],b =[1,2]; a.toString() == b.toString() map let c = {"d":33,"f":44},d = {"d":33,"f":44}; JSON.stringify(c) == JSON.stringify(d); 阅读全文
posted @ 2024-10-21 14:21 流星曳尾 阅读(18) 评论(0) 推荐(0)
摘要:nums: number[] let nums_set:Set<number> = new Set(); for(const num of nums){ nums_set.add(num); } for...of 循环是 ES6 (ECMAScript 2015) 引入的一种新的 for 循环语法, 阅读全文
posted @ 2024-09-27 14:58 流星曳尾 阅读(35) 评论(0) 推荐(0)
摘要:如题 阅读全文
posted @ 2023-05-15 10:56 流星曳尾 阅读(17) 评论(0) 推荐(0)
摘要:不加或者用undefined add(3); add(3,undefined,2); add(a = 1,b = 2, c=3) { ... } 阅读全文
posted @ 2021-08-02 11:47 流星曳尾 阅读(77) 评论(0) 推荐(0)
摘要:arrayCollectionA.source = arrayCollectionB.source; 阅读全文
posted @ 2021-06-11 18:16 流星曳尾 阅读(37) 评论(0) 推荐(0)