From d31172031f5481d44598f8e1dd1aa25d97cca02e Mon Sep 17 00:00:00 2001 From: soyaine Date: Tue, 25 Jun 2019 12:36:47 +0800 Subject: [PATCH 1/8] fix #58 and lint code --- 04 - Array Cardio Day 1/index-SOYAINE.html | 181 +++++++++++---------- 1 file changed, 96 insertions(+), 85 deletions(-) diff --git a/04 - Array Cardio Day 1/index-SOYAINE.html b/04 - Array Cardio Day 1/index-SOYAINE.html index 7419899..f9f8dbf 100644 --- a/04 - Array Cardio Day 1/index-SOYAINE.html +++ b/04 - Array Cardio Day 1/index-SOYAINE.html @@ -6,11 +6,9 @@

请按 F12 查看 Console 面板 💁

-

若无结果请刷新试试

+

若无结果请刷新试试

From 59f2b7cc6ceefd28c56e77247c3d1324ebafbeea Mon Sep 17 00:00:00 2001 From: soyaine <12845017+soyaine@users.noreply.github.com> Date: Tue, 25 Jun 2019 12:42:20 +0800 Subject: [PATCH 2/8] fix #58 variable name --- 04 - Array Cardio Day 1/index-SOYAINE.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/04 - Array Cardio Day 1/index-SOYAINE.html b/04 - Array Cardio Day 1/index-SOYAINE.html index f9f8dbf..a1ff32a 100644 --- a/04 - Array Cardio Day 1/index-SOYAINE.html +++ b/04 - Array Cardio Day 1/index-SOYAINE.html @@ -132,7 +132,7 @@ // 7. sort Exercise // Sort the people alphabetically by last name // 按照姓氏的字母进行排序 - const sortName = inventors.sort((a, b) => { + const sortName = people.sort((a, b) => { return (a.last > b.last) ? 1 : -1; }) console.table(sortName); From f889ba1d3de81636bc8c49e2c4c5b22591768c93 Mon Sep 17 00:00:00 2001 From: soyaine Date: Tue, 25 Jun 2019 14:32:38 +0800 Subject: [PATCH 3/8] style: lint comment code --- 09 - Dev Tools Domination/index-SOYAINE.html | 103 +++++++++--------- .../index-SOYAINE.html | 4 +- 2 files changed, 56 insertions(+), 51 deletions(-) diff --git a/09 - Dev Tools Domination/index-SOYAINE.html b/09 - Dev Tools Domination/index-SOYAINE.html index a8780bd..4dcbabd 100644 --- a/09 - Dev Tools Domination/index-SOYAINE.html +++ b/09 - Dev Tools Domination/index-SOYAINE.html @@ -9,7 +9,13 @@

×点×我×呀×

diff --git a/14 - JavaScript References VS Copying/index-SOYAINE.html b/14 - JavaScript References VS Copying/index-SOYAINE.html index acf3f62..4e11b80 100644 --- a/14 - JavaScript References VS Copying/index-SOYAINE.html +++ b/14 - JavaScript References VS Copying/index-SOYAINE.html @@ -101,8 +101,8 @@ } }; -// console.clear(); -// console.log(wes); + // console.clear(); + // console.log(wes); const dev = Object.assign({}, wes); From 202e91f16a896a860ec39a67462de3a1e9eac150 Mon Sep 17 00:00:00 2001 From: soyaine Date: Thu, 27 Jun 2019 12:09:58 +0800 Subject: [PATCH 4/8] style: lint code --- 06 - Type Ahead/index-SOYAINE.html | 84 ++++++++++++++---------------- 1 file changed, 38 insertions(+), 46 deletions(-) diff --git a/06 - Type Ahead/index-SOYAINE.html b/06 - Type Ahead/index-SOYAINE.html index 927d08d..890247a 100644 --- a/06 - Type Ahead/index-SOYAINE.html +++ b/06 - Type Ahead/index-SOYAINE.html @@ -14,61 +14,53 @@
  • - - - - - - - - + }).join(''); + // console.log(html); + suggestions.innerHTML = html; + } + const search = document.querySelector('.search'); + const suggestions = document.querySelector('.suggestions'); + search.addEventListener('change', displayMatches); + search.addEventListener('keyup', displayMatches); + // console.log(poetrys); + + + \ No newline at end of file From 8e6eeda81645b4f8aa31cc81e529016a9ebcbaaf Mon Sep 17 00:00:00 2001 From: soyaine <12845017+soyaine@users.noreply.github.com> Date: Wed, 14 Jul 2021 15:43:37 +0800 Subject: [PATCH 5/8] remove videos link note #60 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4654e0d..a35c1b4 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ JavaScirpt30 是 Wes Bos 推出的一个 30 天挑战。项目免费提供了 30 下面是完成 Wes Bos 的 JavaScript30 挑战所能借鉴的文档,每个文档的具体使用建议如下: -- [JavaScript30 官网](https://javascript30.com):进入官网注册后可以观看和下载所有教程视频。Wes Bos 还把视频传到了百度云,进入官网直接拉到页面底部就能找到链接。 +- [JavaScript30 官网](https://javascript30.com):进入官网注册后可以观看和下载所有教程视频。 - [Nitish Dayal 写的英文指南](https://github.com/nitishdayal/JavaScript30/tree/master/exercises):这是一份非官方的文字版指南,也是激励我写这一系列文章的主要因素。 - [挑战初始文档](https://github.com/wesbos/JavaScript30):这是 Wes Bos 这份教程涉及的代码,你可以直接 Clone 或者下载到本地,然后开始你 30 天的挑战之旅。文档共有 30 个文件夹,每个文件夹中至少有两个文件。 - **index-START.html**:是提供给我们的初始文档,方便我们专注于 JavaScript 的编写,这个文档已经将基础的 HTML 和 CSS 部分写好,我们只需要在这个基础上编写 JavaScript 代码,实现特定的功能即可。 From 0a6c3e40cf2b87d1ee532ed833765291a6a20258 Mon Sep 17 00:00:00 2001 From: soyaine <12845017+soyaine@users.noreply.github.com> Date: Wed, 14 Jul 2021 15:45:13 +0800 Subject: [PATCH 6/8] update nickname --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a35c1b4..3a0956b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ 创建日期:2016-12-20 最后更新:2018-12-05 -> Repo by: [未枝丫](https://github.com/soyaine) +> Repo by: [Soyaine](https://github.com/soyaine) > [JavaScript30](https://javascript30.com) 教程作者:[Wes Bos](https://github.com/wesbos) > 完整指南在 [GitHub](https://github.com/soyaine/JavaScript30),喜欢请 Star 哦♪(^∇^*) @@ -81,7 +81,7 @@ Name | Contribution [@zzh466](http://github.com/zzh466) | Review [@Xing Liu](https://github.com/S1ngS1ng) | Review [@大史不说话](https://github.com/dashnowords) | No.[16](https://github.com/soyaine/JavaScript30/tree/master/16%20-%20Mouse%20Move%20Shadow).[17](https://github.com/soyaine/JavaScript30/tree/master/17%20-%20Sort%20Without%20Articles).[18](https://github.com/soyaine/JavaScript30/tree/master/18%20-%20AddingUpTimesWithReduce).[19](https://github.com/soyaine/JavaScript30/blob/master/19%20-%20Webcam%20Fun).[20](https://github.com/soyaine/JavaScript30/tree/master/20%20-%20Speech%20Detection).[21](https://github.com/soyaine/JavaScript30/tree/master/21%20-%20Geolocation).[22](https://github.com/soyaine/JavaScript30/tree/master/22%20-%20Follow%20Along%20Link%20Highlighter).[23](https://github.com/soyaine/JavaScript30/tree/master/23%20-%20Speech%20Synthesis).[24](https://github.com/soyaine/JavaScript30/tree/master/24%20-%20Sticky%20Nav).[25](https://github.com/soyaine/JavaScript30/tree/master/25%20-%20Event%20Related).[26](https://github.com/soyaine/JavaScript30/tree/master/26%20-%20Strip%20Follow%20Along%20Nav).[27](https://github.com/soyaine/JavaScript30/tree/master/27%20-%20Click%20and%20Drag).[28](https://github.com/soyaine/JavaScript30/tree/master/28%20-%20Video%20Speed%20Controller) -[@未枝丫](https://github.com/soyaine) | No.[1](https://github.com/soyaine/JavaScript30/tree/master/01%20-%20JavaScript%20Drum%20Kit).[2](https://github.com/soyaine/JavaScript30/tree/master/02%20-%20JS%20%2B%20CSS%20Clock).[3](https://github.com/soyaine/JavaScript30/tree/master/03%20-%20CSS%20%Variables).[4](https://github.com/soyaine/JavaScript30/tree/master/04%20-%20Array%20Cardio%20Day%201).[5](https://github.com/soyaine/JavaScript30/blob/master/05%20-%20Flex%20Panel%20Gallery).[6](https://github.com/soyaine/JavaScript30/blob/master/06%20-%20Type%20Ahead).[7](https://github.com/soyaine/JavaScript30/tree/master/07%20-%20Array%20Cardio%20Day%202).[8](https://github.com/soyaine/JavaScript30/tree/master/08%20-%20Fun%20with%20HTML5%20Canvas).[9](https://github.com/soyaine/JavaScript30/blob/master/09%20-%20Dev%20Tools%20Domination).[10](https://github.com/soyaine/JavaScript30/blob/master/10%20-%20Hold%20Shift%20and%20Check%20Checkboxes/README.md).[12](https://github.com/soyaine/JavaScript30/tree/master/12%20-%20Key%20Sequence%20Detection/README.md).[13](https://github.com/soyaine/JavaScript30/blob/master/13%20-%20Slide%20in%20on%20Scroll/README.md).[14](https://github.com/soyaine/JavaScript30/tree/master/14%20-%20JavaScript%20References%20VS%20Copying) +[@Soyaine](https://github.com/soyaine) | No.[1](https://github.com/soyaine/JavaScript30/tree/master/01%20-%20JavaScript%20Drum%20Kit).[2](https://github.com/soyaine/JavaScript30/tree/master/02%20-%20JS%20%2B%20CSS%20Clock).[3](https://github.com/soyaine/JavaScript30/tree/master/03%20-%20CSS%20%Variables).[4](https://github.com/soyaine/JavaScript30/tree/master/04%20-%20Array%20Cardio%20Day%201).[5](https://github.com/soyaine/JavaScript30/blob/master/05%20-%20Flex%20Panel%20Gallery).[6](https://github.com/soyaine/JavaScript30/blob/master/06%20-%20Type%20Ahead).[7](https://github.com/soyaine/JavaScript30/tree/master/07%20-%20Array%20Cardio%20Day%202).[8](https://github.com/soyaine/JavaScript30/tree/master/08%20-%20Fun%20with%20HTML5%20Canvas).[9](https://github.com/soyaine/JavaScript30/blob/master/09%20-%20Dev%20Tools%20Domination).[10](https://github.com/soyaine/JavaScript30/blob/master/10%20-%20Hold%20Shift%20and%20Check%20Checkboxes/README.md).[12](https://github.com/soyaine/JavaScript30/tree/master/12%20-%20Key%20Sequence%20Detection/README.md).[13](https://github.com/soyaine/JavaScript30/blob/master/13%20-%20Slide%20in%20on%20Scroll/README.md).[14](https://github.com/soyaine/JavaScript30/tree/master/14%20-%20JavaScript%20References%20VS%20Copying) ## JOIN US 如果对这个系列的指南有什么改进的想法,欢迎[提 issue](https://github.com/soyaine/JavaScript30/issues),如果你也想参与写作,请看 [wiki](https://github.com/soyaine/JavaScript30/wiki/%E6%8C%87%E5%8D%97%E7%BB%93%E6%9E%84%E8%AF%B4%E6%98%8E),并联系 Soyaine。 From f4232a6e3c9db9dbcd0b6288a27d919832eec0ec Mon Sep 17 00:00:00 2001 From: soyaine <12845017+soyaine@users.noreply.github.com> Date: Mon, 11 Jul 2022 11:08:49 +0800 Subject: [PATCH 7/8] =?UTF-8?q?fix=20#65=20=E4=BF=AE=E5=A4=8D=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 3 的排序没有使用字段 4 排序用错了变量名 7 里面也用错了字段名,应该取逗号后的单词 --- 04 - Array Cardio Day 1/README.md | 4 ++-- 04 - Array Cardio Day 1/index-SOYAINE.html | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/04 - Array Cardio Day 1/README.md b/04 - Array Cardio Day 1/README.md index 6d41224..ffff200 100644 --- a/04 - Array Cardio Day 1/README.md +++ b/04 - Array Cardio Day 1/README.md @@ -1,6 +1,6 @@ # 04 Array Cardio 💪 指南一 -> 作者:©[未枝丫](https://github.com/soyaine) +> 作者:©[Soyaine](https://github.com/soyaine) > 简介:[JavaScript30](https://javascript30.com) 是 [Wes Bos](https://github.com/wesbos) 推出的一个 30 天挑战。项目免费提供了 30 个视频教程、30 个挑战的起始文档和 30 个挑战解决方案源代码。目的是帮助人们用纯 JavaScript 来写东西,不借助框架和库,也不使用编译器和引用。现在你看到的是这系列指南的第 4 篇。完整指南在 [GitHub](https://github.com/soyaine/JavaScript30),喜欢请 Star 哦♪(^∇^*) ## 实现效果 @@ -27,7 +27,7 @@ console.table(thing) 4. 计算所有的发明家加起来一共活了多少岁 5. 按照他们活了多久来进行排序 6. 筛选出一个网页里含有某个词语的标题 -7. 按照姓氏来对发明家进行排序 +7. 按照姓氏来进行排序 8. 统计给出数组中各个物品的数量 ## 相关知识 diff --git a/04 - Array Cardio Day 1/index-SOYAINE.html b/04 - Array Cardio Day 1/index-SOYAINE.html index a1ff32a..5408bdc 100644 --- a/04 - Array Cardio Day 1/index-SOYAINE.html +++ b/04 - Array Cardio Day 1/index-SOYAINE.html @@ -44,12 +44,13 @@ // Array.prototype.filter() // 1. Filter the list of inventors for those who were born in the 1500's - // 筛选 16 世纪出生的人 + // 1. 筛选 16 世纪出生的人 const fifteen = inventors.filter(function (inventor) { if (inventor.year >= 1500 && inventor.year < 1600) { return true; } }); + console.log('1. 筛选 16 世纪出生的人'); console.table(fifteen); const __fifteen = inventors.filter(inventor => (inventor.year >= 1500 && inventor.year < 1600)); @@ -59,6 +60,7 @@ // Array.prototype.map() // 2. Give us an array of the inventors' first and last names // 展示上面发明家的姓名 + console.log('2. 展示上面发明家的姓名'); const fullNames = inventors.map(inventor => inventor.first + ' ' + inventor.last); // const fullNames = inventors.map(inventor => `${inventor.first} ${inventor.last}`); console.log(fullNames); @@ -67,6 +69,7 @@ // Array.prototype.sort() // 3. Sort the inventors by birthdate, oldest to youngest // 把这些人从大到小进行排序 + console.log('3. 把发明家从大到小进行排序'); // const ordered = inventors.sort(function(firstName, secondName) { // if(firstName.year > secondName.year) { // return 1; // 对 sort 函数,返回值为 -1 排在前面,1 排在后面 @@ -76,13 +79,15 @@ // }); // console.table(ordered); - const __ordered = inventors.sort((a, b) => (a > b) ? 1 : -1); + const __ordered = inventors.sort((a, b) => (a.year > b.year) ? 1 : -1); console.table(__ordered); // Array.prototype.reduce() // 4. How many years did all the inventors live // 他们所有人一共活了多少岁 + console.log('4. 所有发明家一共活了多少岁'); + // 下面三种写法是一样的效果 // var total = 0; // for(var i = 0; i < inventors.length; i++) { @@ -102,7 +107,8 @@ // 5. Sort the inventors by years lived、 // 按照他们在世的岁数进行排序 - const oldest = people.sort((a, b) => { + console.log('5. 按照发明家在世的岁数进行排序'); + const oldest = inventors.sort((a, b) => { const last = a.passed - a.year; const next = b.passed - b.year; return (next < last) ? -1 : 1; @@ -131,9 +137,10 @@ // 7. sort Exercise // Sort the people alphabetically by last name - // 按照姓氏的字母进行排序 + // 按照姓氏(逗号后面的单词)的字母进行排序 + console.log('7. 按照people姓氏(逗号后面的单词)的字母进行排序'); const sortName = people.sort((a, b) => { - return (a.last > b.last) ? 1 : -1; + return (a.split(', ')[1] > b.split(', ')[1]) ? 1 : -1; }) console.table(sortName); @@ -141,6 +148,7 @@ // 8. Reduce Exercise // Sum up the instances of each of these // 统计各个物品的数量 + console.log('8. 统计各个物品的数量'); const data = ['car', 'car', 'truck', 'truck', 'bike', 'walk', 'car', 'van', 'bike', 'walk', 'car', 'van', 'car', 'truck' ]; From bef7bbfe74259748487c515787b0a688692932fc Mon Sep 17 00:00:00 2001 From: longlin li Date: Tue, 15 Oct 2024 00:31:45 +0800 Subject: [PATCH 8/8] typo: change 'asset' to 'assert' --- 09 - Dev Tools Domination/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/09 - Dev Tools Domination/README.md b/09 - Dev Tools Domination/README.md index f103fc4..8335d96 100644 --- a/09 - Dev Tools Domination/README.md +++ b/09 - Dev Tools Domination/README.md @@ -64,7 +64,7 @@ console.dir(p); 要清空已经打印输出的内容,有两种方式,一种是 JavaScript 语句: `console.clear()`。另一个是快捷键 Ctrl + L。 -### asset 方法进行测试 +### assert 方法进行测试 接受一个表达式作为参数,如果参数返回值是 false,则会输出第二个参数中的内容。