From fc2c9cd84e54df3bc6e76939b27960feb95f8bed Mon Sep 17 00:00:00 2001 From: hbybyyang <2451759073@qq.com> Date: Sun, 10 Jan 2021 13:35:23 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=89=E4=B8=AA?= =?UTF-8?q?=E7=89=87=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\347\211\207\346\256\265/javascript.json" | 61 +++++++++++++++++----- 1 file changed, 48 insertions(+), 13 deletions(-) diff --git "a/\347\211\207\346\256\265/javascript.json" "b/\347\211\207\346\256\265/javascript.json" index 66ce9d7..62783cf 100644 --- "a/\347\211\207\346\256\265/javascript.json" +++ "b/\347\211\207\346\256\265/javascript.json" @@ -1,14 +1,49 @@ { - "出现次数": { - "prefix": [ - "array", - "ChuXianCiShu", - "出现次数" - ], - "body": [ - "const 统计出现次数 = (数组, 值) => 数组.reduce((次数, 项) => (项 === 值 ? 次数 + 1 : 次数), 0);", - "统计出现次数(${1:数组}, ${2:值});" - ], - "description": "统计数组中某个值出现的次数" - } -} \ No newline at end of file + "出现次数": { + "prefix": [ + "array", + "ChuXianCiShu", + "出现次数" + ], + "body": [ + "const 统计出现次数 = (数组, 值) => 数组.reduce((次数, 项) => (项 === 值 ? 次数 + 1 : 次数), 0);", + "统计出现次数(${1:数组}, ${2:值});" + ], + "description": "统计数组中某个值出现的次数" + }, + "范围数组": { + "prefix": [ + "范围数组", + "fanweishuzu" + ], + "body": [ + "[...Array(${1:10}).keys()]" + ], + "description": "范围数组" + }, + "输出": { + "prefix": [ + "打印", + "输出", + "dayin", + "shuchu" + ], + "body": [ + "console.log(${0:'hello, world!'})" + ], + "description": "输出" + }, + "多重笛卡尔积": { + "prefix": [ + "多重笛卡尔积", + "duochongdikaerji" + ], + "body": [ + "(a => a.reduce((as, bs) => as.map(a => bs.map(b => [...a, b])).flat(), [[]]))([", + "${0}[0, 1],", + "[2, 3],", + "])" + ], + "description": "多重笛卡尔积" + } +} -- Gitee From 1bea5063172fa5173d79385fe721b2bc7d53ca34 Mon Sep 17 00:00:00 2001 From: hbybyyang <2451759073@qq.com> Date: Sun, 10 Jan 2021 14:44:40 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A6=99=E5=95=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\347\211\207\346\256\265/javascript.json" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/\347\211\207\346\256\265/javascript.json" "b/\347\211\207\346\256\265/javascript.json" index 62783cf..5cbc2fd 100644 --- "a/\347\211\207\346\256\265/javascript.json" +++ "b/\347\211\207\346\256\265/javascript.json" @@ -29,7 +29,7 @@ "shuchu" ], "body": [ - "console.log(${0:'hello, world!'})" + "console.log('${0:你好, 世界!}')" ], "description": "输出" }, -- Gitee