diff --git "a/2019/Commit Message\350\247\204\350\214\203.html" "b/2019/Commit Message\350\247\204\350\214\203.html" index 394504981..c77feab8d 100644 --- "a/2019/Commit Message\350\247\204\350\214\203.html" +++ "b/2019/Commit Message\350\247\204\350\214\203.html" @@ -1149,7 +1149,7 @@

- Blog总字数: 286.9k字 + Blog总字数: 288.0k字
diff --git "a/2019/ECMAScript 2016\343\200\2012017\343\200\2012018 \346\226\260\347\211\271\346\200\247 .html" "b/2019/ECMAScript 2016\343\200\2012017\343\200\2012018 \346\226\260\347\211\271\346\200\247 .html" index 6b9bd9edf..8b12d7fb7 100644 --- "a/2019/ECMAScript 2016\343\200\2012017\343\200\2012018 \346\226\260\347\211\271\346\200\247 .html" +++ "b/2019/ECMAScript 2016\343\200\2012017\343\200\2012018 \346\226\260\347\211\271\346\200\247 .html" @@ -978,7 +978,7 @@

- Blog总字数: 286.9k字 + Blog总字数: 288.0k字

diff --git a/2019/ES6Proxy.html b/2019/ES6Proxy.html index f900751a2..ee2fa331e 100644 --- a/2019/ES6Proxy.html +++ b/2019/ES6Proxy.html @@ -999,7 +999,7 @@

- Blog总字数: 286.9k字 + Blog总字数: 288.0k字

diff --git "a/2019/ES6Reflect\345\257\271\350\261\241.html" "b/2019/ES6Reflect\345\257\271\350\261\241.html" index da00a1484..f855b1dd1 100644 --- "a/2019/ES6Reflect\345\257\271\350\261\241.html" +++ "b/2019/ES6Reflect\345\257\271\350\261\241.html" @@ -996,7 +996,7 @@

- Blog总字数: 286.9k字 + Blog总字数: 288.0k字

diff --git a/2019/EventLoop.html b/2019/EventLoop.html index 11db9d253..f5b602369 100644 --- a/2019/EventLoop.html +++ b/2019/EventLoop.html @@ -1044,7 +1044,7 @@

参考
- Blog总字数: 286.9k字 + Blog总字数: 288.0k字

diff --git "a/2019/JS\345\207\275\346\225\260\345\237\272\347\241\200.html" "b/2019/JS\345\207\275\346\225\260\345\237\272\347\241\200.html" index 7ff6700af..bda28751c 100644 --- "a/2019/JS\345\207\275\346\225\260\345\237\272\347\241\200.html" +++ "b/2019/JS\345\207\275\346\225\260\345\237\272\347\241\200.html" @@ -1018,7 +1018,7 @@

- Blog总字数: 286.9k字 + Blog总字数: 288.0k字

diff --git "a/2019/NodeJSHttp\345\212\240\350\275\275\351\235\231\346\200\201\350\265\204\346\272\220.html" "b/2019/NodeJSHttp\345\212\240\350\275\275\351\235\231\346\200\201\350\265\204\346\272\220.html" index 7ad092247..46e4d0daa 100644 --- "a/2019/NodeJSHttp\345\212\240\350\275\275\351\235\231\346\200\201\350\265\204\346\272\220.html" +++ "b/2019/NodeJSHttp\345\212\240\350\275\275\351\235\231\346\200\201\350\265\204\346\272\220.html" @@ -953,7 +953,7 @@

- Blog总字数: 286.9k字 + Blog总字数: 288.0k字

diff --git "a/2019/PWA\346\211\213\350\256\260.html" "b/2019/PWA\346\211\213\350\256\260.html" index e2fcbb7b2..6f31b2869 100644 --- "a/2019/PWA\346\211\213\350\256\260.html" +++ "b/2019/PWA\346\211\213\350\256\260.html" @@ -1137,7 +1137,7 @@

- Blog总字数: 286.9k字 + Blog总字数: 288.0k字

diff --git "a/2019/blur\344\272\213\344\273\266\344\270\216click\344\272\213\344\273\266\345\206\262\347\252\201\347\232\204\350\247\243\345\206\263\345\212\236\346\263\225.html" "b/2019/blur\344\272\213\344\273\266\344\270\216click\344\272\213\344\273\266\345\206\262\347\252\201\347\232\204\350\247\243\345\206\263\345\212\236\346\263\225.html" index 925771869..007f9bc34 100644 --- "a/2019/blur\344\272\213\344\273\266\344\270\216click\344\272\213\344\273\266\345\206\262\347\252\201\347\232\204\350\247\243\345\206\263\345\212\236\346\263\225.html" +++ "b/2019/blur\344\272\213\344\273\266\344\270\216click\344\272\213\344\273\266\345\206\262\347\252\201\347\232\204\350\247\243\345\206\263\345\212\236\346\263\225.html" @@ -960,7 +960,7 @@

- Blog总字数: 286.9k字 + Blog总字数: 288.0k字

diff --git "a/2019/borderRadius\347\231\276\345\210\206\346\257\22450\345\222\214100\347\251\266\347\253\237\346\234\211\344\273\200\344\271\210\345\214\272\345\210\253.html" "b/2019/borderRadius\347\231\276\345\210\206\346\257\22450\345\222\214100\347\251\266\347\253\237\346\234\211\344\273\200\344\271\210\345\214\272\345\210\253.html" index 52358078a..a162a082d 100644 --- "a/2019/borderRadius\347\231\276\345\210\206\346\257\22450\345\222\214100\347\251\266\347\253\237\346\234\211\344\273\200\344\271\210\345\214\272\345\210\253.html" +++ "b/2019/borderRadius\347\231\276\345\210\206\346\257\22450\345\222\214100\347\251\266\347\253\237\346\234\211\344\273\200\344\271\210\345\214\272\345\210\253.html" @@ -954,7 +954,7 @@

- Blog总字数: 286.9k字 + Blog总字数: 288.0k字

diff --git "a/2019/git\347\233\270\345\205\263\351\227\256\351\242\230\345\234\272\346\231\257\345\222\214\345\221\275\344\273\244.html" "b/2019/git\347\233\270\345\205\263\351\227\256\351\242\230\345\234\272\346\231\257\345\222\214\345\221\275\344\273\244.html" index 8c472fadf..adc578e89 100644 --- "a/2019/git\347\233\270\345\205\263\351\227\256\351\242\230\345\234\272\346\231\257\345\222\214\345\221\275\344\273\244.html" +++ "b/2019/git\347\233\270\345\205\263\351\227\256\351\242\230\345\234\272\346\231\257\345\222\214\345\221\275\344\273\244.html" @@ -1185,7 +1185,7 @@

参考
- Blog总字数: 286.9k字 + Blog总字数: 288.0k字

diff --git "a/2019/javascript\350\256\276\350\256\241\346\250\241\345\274\217.html" "b/2019/javascript\350\256\276\350\256\241\346\250\241\345\274\217.html" index ab4324fb1..980ccf1d4 100644 --- "a/2019/javascript\350\256\276\350\256\241\346\250\241\345\274\217.html" +++ "b/2019/javascript\350\256\276\350\256\241\346\250\241\345\274\217.html" @@ -1094,7 +1094,7 @@

- Blog总字数: 286.9k字 + Blog总字数: 288.0k字
diff --git "a/2019/linux\345\256\211\350\243\205mongodb\345\217\212\345\270\270\350\247\201\345\221\275\344\273\244.html" "b/2019/linux\345\256\211\350\243\205mongodb\345\217\212\345\270\270\350\247\201\345\221\275\344\273\244.html" index e496e69b9..979522dc9 100644 --- "a/2019/linux\345\256\211\350\243\205mongodb\345\217\212\345\270\270\350\247\201\345\221\275\344\273\244.html" +++ "b/2019/linux\345\256\211\350\243\205mongodb\345\217\212\345\270\270\350\247\201\345\221\275\344\273\244.html" @@ -951,7 +951,7 @@

- Blog总字数: 286.9k字 + Blog总字数: 288.0k字

diff --git "a/2019/\345\205\263\344\272\216requestAnimationFrame.html" "b/2019/\345\205\263\344\272\216requestAnimationFrame.html" index 30eefe895..a7e87f59a 100644 --- "a/2019/\345\205\263\344\272\216requestAnimationFrame.html" +++ "b/2019/\345\205\263\344\272\216requestAnimationFrame.html" @@ -979,7 +979,7 @@

5
- Blog总字数: 286.9k字 + Blog总字数: 288.0k字
diff --git "a/2019/\345\211\215\347\253\257\346\250\241\345\235\227\345\214\226\345\217\221\345\261\225.html" "b/2019/\345\211\215\347\253\257\346\250\241\345\235\227\345\214\226\345\217\221\345\261\225.html" index 05bb9dd6f..a9033c1fa 100644 --- "a/2019/\345\211\215\347\253\257\346\250\241\345\235\227\345\214\226\345\217\221\345\261\225.html" +++ "b/2019/\345\211\215\347\253\257\346\250\241\345\235\227\345\214\226\345\217\221\345\261\225.html" @@ -1071,7 +1071,7 @@

- Blog总字数: 286.9k字 + Blog总字数: 288.0k字

diff --git "a/2019/\345\217\221\345\270\203\350\256\242\351\230\205\346\250\241\345\274\217.html" "b/2019/\345\217\221\345\270\203\350\256\242\351\230\205\346\250\241\345\274\217.html" index 0af4343cd..54ffb91c0 100644 --- "a/2019/\345\217\221\345\270\203\350\256\242\351\230\205\346\250\241\345\274\217.html" +++ "b/2019/\345\217\221\345\270\203\350\256\242\351\230\205\346\250\241\345\274\217.html" @@ -918,7 +918,7 @@

事件机制

- Blog总字数: 286.9k字 + Blog总字数: 288.0k字
diff --git "a/2019/\346\225\210\347\216\207\345\267\245\344\275\234.html" "b/2019/\346\225\210\347\216\207\345\267\245\344\275\234.html" index b9c4ea988..06cfa1fde 100644 --- "a/2019/\346\225\210\347\216\207\345\267\245\344\275\234.html" +++ "b/2019/\346\225\210\347\216\207\345\267\245\344\275\234.html" @@ -974,7 +974,7 @@

效率工作

- Blog总字数: 286.9k字 + Blog总字数: 288.0k字
diff --git "a/2019/\346\265\217\350\247\210\345\231\250\345\205\274\345\256\271\351\227\256\351\242\230\346\200\273\347\273\223.html" "b/2019/\346\265\217\350\247\210\345\231\250\345\205\274\345\256\271\351\227\256\351\242\230\346\200\273\347\273\223.html" index 6573b5e04..33de7e7a2 100644 --- "a/2019/\346\265\217\350\247\210\345\231\250\345\205\274\345\256\271\351\227\256\351\242\230\346\200\273\347\273\223.html" +++ "b/2019/\346\265\217\350\247\210\345\231\250\345\205\274\345\256\271\351\227\256\351\242\230\346\200\273\347\273\223.html" @@ -139,7 +139,7 @@ - + @@ -413,12 +413,12 @@

Blog

- @@ -610,7 +610,38 @@

浏览器兼容问题总结

  • display:inline-block 什么时候会显示间隙? 移除空格、使用margin负值、使用font-size:0、letter-spacing、word-spacing

  • +
  • ul标签内外边距问题ul标签在IE6\IE7中,有个默认的外边距,但是在IE8以上及其他浏览器中有个默认的内边距。 +解决方法:统一设置ul的内外边距为0

    +
  • +
  • IE6下图片的下方有空隙 +解决方法:给img设置display:block;

    +
  • +
  • IE6下两个float之间会有个3px的bug +解决办法:给右边的元素也设置float:left;

    +
  • +
  • IE6下没有min-width的概念,其默认的width就是min-width

    +
  • +
  • IE6下在使用margin:0 auto;无法使其居中 +解决办法:为其父容器设置text-align:center;

    +
  • +
  • 被点击过后的超链接不再具有hover和active属性 +解决办法:按lvha的顺序书写css样式,

    +
  • +
      +
    • “:link”: a标签还未被访问的状态;
    • +
    • “:visited”: a标签已被访问过的状态;
    • +
    • “:hover”: 鼠标悬停在a标签上的状态;
    • +
    • “:active”: a标签被鼠标按着时的状态;
    • +
    +
      +
    1. 标准事件绑定 +addEventListener/attachEvent、event.target/event.srcElement、XMLHttpRequest/ActiveXObject(‘Microsoft.XMLHTTP’)
    2. +
    +
      +
    • 获取dom的父子节点 +parentNode/parentElement
    • +
    @@ -642,7 +673,7 @@

    浏览器兼容问题总结

    本文标题:浏览器兼容问题总结

    文章作者:陈宇(cosyer)

    发布时间:2019年09月01日 - 01:09

    -

    最后更新:2020年09月05日 - 21:09

    +

    最后更新:2020年09月08日 - 19:09

    原始链接:http://mydearest.cn/2019/%E6%B5%8F%E8%A7%88%E5%99%A8%E5%85%BC%E5%AE%B9%E9%97%AE%E9%A2%98%E6%80%BB%E7%BB%93.html

    @@ -966,7 +997,7 @@

    浏览器兼容问题总结

    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字
    diff --git "a/2019/\346\267\261\345\205\245\344\272\206\350\247\243HTTP.html" "b/2019/\346\267\261\345\205\245\344\272\206\350\247\243HTTP.html" index 5f214f66a..9b40e2353 100644 --- "a/2019/\346\267\261\345\205\245\344\272\206\350\247\243HTTP.html" +++ "b/2019/\346\267\261\345\205\245\344\272\206\350\247\243HTTP.html" @@ -1085,7 +1085,7 @@

    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字

    diff --git "a/2019/\346\267\261\345\205\245\347\220\206\350\247\243JS\347\232\204\347\261\273\345\236\213\343\200\201\345\200\274\345\222\214\347\261\273\345\236\213\350\275\254\346\215\242.html" "b/2019/\346\267\261\345\205\245\347\220\206\350\247\243JS\347\232\204\347\261\273\345\236\213\343\200\201\345\200\274\345\222\214\347\261\273\345\236\213\350\275\254\346\215\242.html" index bffa11d2b..4d5708064 100644 --- "a/2019/\346\267\261\345\205\245\347\220\206\350\247\243JS\347\232\204\347\261\273\345\236\213\343\200\201\345\200\274\345\222\214\347\261\273\345\236\213\350\275\254\346\215\242.html" +++ "b/2019/\346\267\261\345\205\245\347\220\206\350\247\243JS\347\232\204\347\261\273\345\236\213\343\200\201\345\200\274\345\222\214\347\261\273\345\236\213\350\275\254\346\215\242.html" @@ -1068,7 +1068,7 @@

    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字
    diff --git "a/2019/\347\273\264\347\224\237\347\264\240.html" "b/2019/\347\273\264\347\224\237\347\264\240.html" index 577606859..a785be81e 100644 --- "a/2019/\347\273\264\347\224\237\347\264\240.html" +++ "b/2019/\347\273\264\347\224\237\347\264\240.html" @@ -965,7 +965,7 @@

    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字

    diff --git "a/2020/30\345\210\206\351\222\237\347\262\276\351\200\232React Hooks.html" "b/2020/30\345\210\206\351\222\237\347\262\276\351\200\232React Hooks.html" index 1cedb6f62..bcb80d417 100644 --- "a/2020/30\345\210\206\351\222\237\347\262\276\351\200\232React Hooks.html" +++ "b/2020/30\345\210\206\351\222\237\347\262\276\351\200\232React Hooks.html" @@ -139,7 +139,7 @@ - + @@ -413,12 +413,12 @@

    Blog

    -
    diff --git "a/2020/Angular\347\273\204\344\273\266\351\200\232\350\256\257.html" "b/2020/Angular\347\273\204\344\273\266\351\200\232\350\256\257.html" index 54ac8dc64..1b60b4641 100644 --- "a/2020/Angular\347\273\204\344\273\266\351\200\232\350\256\257.html" +++ "b/2020/Angular\347\273\204\344\273\266\351\200\232\350\256\257.html" @@ -983,7 +983,7 @@

    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字

    diff --git "a/2020/HTML\344\270\255p\346\240\207\347\255\276\344\270\255\346\217\222\345\205\245div\346\240\207\347\255\276\344\274\232\345\217\221\347\224\237\344\273\200\344\271\210.html" "b/2020/HTML\344\270\255p\346\240\207\347\255\276\344\270\255\346\217\222\345\205\245div\346\240\207\347\255\276\344\274\232\345\217\221\347\224\237\344\273\200\344\271\210.html" index 86a47adec..ac25f6994 100644 --- "a/2020/HTML\344\270\255p\346\240\207\347\255\276\344\270\255\346\217\222\345\205\245div\346\240\207\347\255\276\344\274\232\345\217\221\347\224\237\344\273\200\344\271\210.html" +++ "b/2020/HTML\344\270\255p\346\240\207\347\255\276\344\270\255\346\217\222\345\205\245div\346\240\207\347\255\276\344\274\232\345\217\221\347\224\237\344\273\200\344\271\210.html" @@ -132,17 +132,17 @@ - + - + - + @@ -417,12 +417,12 @@

    Blog

    -
    @@ -607,7 +609,7 @@

    HTML中p标签中插入div标签

    本文标题:HTML中p标签中插入div标签会发生什么

    文章作者:陈宇(cosyer)

    发布时间:2020年09月02日 - 11:09

    -

    最后更新:2020年09月05日 - 20:09

    +

    最后更新:2020年09月08日 - 19:09

    原始链接:http://mydearest.cn/2020/HTML%E4%B8%ADp%E6%A0%87%E7%AD%BE%E4%B8%AD%E6%8F%92%E5%85%A5div%E6%A0%87%E7%AD%BE%E4%BC%9A%E5%8F%91%E7%94%9F%E4%BB%80%E4%B9%88.html

    @@ -927,7 +929,7 @@

    HTML中p标签中插入div标签
    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字
    diff --git a/2020/Hybrid.html b/2020/Hybrid.html index 5f44c63c2..c468206c3 100644 --- a/2020/Hybrid.html +++ b/2020/Hybrid.html @@ -1024,7 +1024,7 @@

    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字

    diff --git "a/2020/TypeScript \344\270\255\357\274\214interface \345\222\214 type \347\232\204\345\214\272\345\210\253.html" "b/2020/TypeScript \344\270\255\357\274\214interface \345\222\214 type \347\232\204\345\214\272\345\210\253.html" index 91e13834f..69533332f 100644 --- "a/2020/TypeScript \344\270\255\357\274\214interface \345\222\214 type \347\232\204\345\214\272\345\210\253.html" +++ "b/2020/TypeScript \344\270\255\357\274\214interface \345\222\214 type \347\232\204\345\214\272\345\210\253.html" @@ -950,7 +950,7 @@

    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字

    diff --git "a/2020/js\344\272\214\350\277\233\345\210\266\345\222\214\344\275\215\350\277\220\347\256\227.html" "b/2020/js\344\272\214\350\277\233\345\210\266\345\222\214\344\275\215\350\277\220\347\256\227.html" index f826a4e89..88ec12b54 100644 --- "a/2020/js\344\272\214\350\277\233\345\210\266\345\222\214\344\275\215\350\277\220\347\256\227.html" +++ "b/2020/js\344\272\214\350\277\233\345\210\266\345\222\214\344\275\215\350\277\220\347\256\227.html" @@ -1048,7 +1048,7 @@

    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字

    diff --git "a/2020/react SSR\346\225\231\347\250\213.html" "b/2020/react SSR\346\225\231\347\250\213.html" index 9ec548ded..eb53f9a77 100644 --- "a/2020/react SSR\346\225\231\347\250\213.html" +++ "b/2020/react SSR\346\225\231\347\250\213.html" @@ -1020,7 +1020,7 @@

    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字

    diff --git a/2020/vueInterview.html b/2020/vueInterview.html index 49fab5833..dcc86c73a 100644 --- a/2020/vueInterview.html +++ b/2020/vueInterview.html @@ -139,7 +139,7 @@ - + @@ -414,12 +414,12 @@

    Blog

    -
    @@ -1051,7 +1070,7 @@

    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字

    diff --git "a/2020/\345\205\263\344\272\216node\347\232\204\351\202\243\344\272\233\344\272\213(\350\277\233\351\230\266\347\257\207).html" "b/2020/\345\205\263\344\272\216node\347\232\204\351\202\243\344\272\233\344\272\213(\350\277\233\351\230\266\347\257\207).html" index 075900f91..5891d45fa 100644 --- "a/2020/\345\205\263\344\272\216node\347\232\204\351\202\243\344\272\233\344\272\213(\350\277\233\351\230\266\347\257\207).html" +++ "b/2020/\345\205\263\344\272\216node\347\232\204\351\202\243\344\272\233\344\272\213(\350\277\233\351\230\266\347\257\207).html" @@ -139,7 +139,7 @@ - + @@ -413,12 +413,12 @@

    Blog

    -
    diff --git "a/2020/\345\244\247\346\226\207\344\273\266\345\210\206\347\211\207\344\270\212\344\274\240\344\274\230\345\214\226.html" "b/2020/\345\244\247\346\226\207\344\273\266\345\210\206\347\211\207\344\270\212\344\274\240\344\274\230\345\214\226.html" index 56cf4de1a..6f273cd6b 100644 --- "a/2020/\345\244\247\346\226\207\344\273\266\345\210\206\347\211\207\344\270\212\344\274\240\344\274\230\345\214\226.html" +++ "b/2020/\345\244\247\346\226\207\344\273\266\345\210\206\347\211\207\344\270\212\344\274\240\344\274\230\345\214\226.html" @@ -984,7 +984,7 @@

    总结
    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字

    diff --git "a/2020/\345\246\202\344\275\225\345\234\250 create-react-app \344\270\255\344\275\277\347\224\250 CSS Modules.html" "b/2020/\345\246\202\344\275\225\345\234\250 create-react-app \344\270\255\344\275\277\347\224\250 CSS Modules.html" index ea67d30e4..a95c73589 100644 --- "a/2020/\345\246\202\344\275\225\345\234\250 create-react-app \344\270\255\344\275\277\347\224\250 CSS Modules.html" +++ "b/2020/\345\246\202\344\275\225\345\234\250 create-react-app \344\270\255\344\275\277\347\224\250 CSS Modules.html" @@ -982,7 +982,7 @@

    总结
    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字

    diff --git "a/2020/\345\256\236\347\216\260compose.html" "b/2020/\345\256\236\347\216\260compose.html" index c7d5d6939..a33c9566f 100644 --- "a/2020/\345\256\236\347\216\260compose.html" +++ "b/2020/\345\256\236\347\216\260compose.html" @@ -978,7 +978,7 @@

    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字

    diff --git "a/2020/\345\256\236\347\216\260\345\233\276\347\211\207\346\207\222\345\212\240\350\275\275.html" "b/2020/\345\256\236\347\216\260\345\233\276\347\211\207\346\207\222\345\212\240\350\275\275.html" index 6d9dd8901..c633109b0 100644 --- "a/2020/\345\256\236\347\216\260\345\233\276\347\211\207\346\207\222\345\212\240\350\275\275.html" +++ "b/2020/\345\256\236\347\216\260\345\233\276\347\211\207\346\207\222\345\212\240\350\275\275.html" @@ -966,7 +966,7 @@

    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字

    diff --git "a/2020/\347\256\227\346\263\225\351\242\230\347\273\203\344\271\240.html" "b/2020/\347\256\227\346\263\225\351\242\230\347\273\203\344\271\240.html" index 979124650..50e8531b0 100644 --- "a/2020/\347\256\227\346\263\225\351\242\230\347\273\203\344\271\240.html" +++ "b/2020/\347\256\227\346\263\225\351\242\230\347\273\203\344\271\240.html" @@ -143,7 +143,7 @@ - + @@ -418,12 +418,12 @@

    Blog

    - @@ -646,7 +646,7 @@

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    function fn() {
    const arr = []
    for (let i = 2; i <= 100; i++) {
    let bl = false
    for (let j = 2; j <= i; j++) {
    if (i === j) continue
    i % j === 0 && (bl = true)
    }
    !bl && arr.push(i)
    }
    return arr
    }
    console.log(fn())
    -

    给定一个整数数组,实现快速排序算法进行升序排列。如[2, 5, 8, 9, 3] =>[2, 3, 5, 8, 9]

    解析:(分治法) +

    (数组中第K大元素)给定一个整数数组,实现快速排序算法进行升序排列。如[2, 5, 8, 9, 3] =>[2, 3, 5, 8, 9]

    解析:(分治法) 将一个列表分割为左右两块,然后再将字列表再进行分割为左右两块,如何反复,知道子元素长度为1时,结束!

    • 代码实现
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      function qSort(arr) {
      if (arr.length <= 1) return arr
      const index = Math.floor(arr.length / 2)
      const midVal = arr.splice(index, 1)[0]
      const left = [],
      right = []
      arr.forEach(item => {
      if (item < midVal) left.push(item)
      else right.push(item)
      })
      return [...qSort(left), midVal, ...qSort(right)]
      }
      qSort([2, 5, 8, 9, 3])
      @@ -665,8 +665,9 @@

      时间复杂度:O(n)空间复杂度O(1)

      1
      2
      3
      4
      5
      6
      7
      8
      9
      function shuffle(arr) {
      var newArr = [];
      for(var i = 0, len = arr.length; i < len; i++) {
      var j = Math.floor(Math.random() * (len - i));
      newArr[i] = arr[j];
      arr.splice(j, 1)
      }
      return newArr;
      }

      两数之和

      [2,7,11,88,34],9 => [0,1]

      双循环

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      function twoSum(arr, target) {
      var result = []
      for (let m=0;m<arr.length -1;m++) {
      for (let n= m+1;n<arr.length;n++) {
      if(arr[m]+arr[n]===target){
      result.push(m,n)
      return result
      }
      }
      }
      }
      -

      Map

      1
      2
      3
      4
      5
      6
      7
      8
      9
      function(arr, target) {
      let result = new Map()
      for(let i=0;i<arr.length;i++){
      if(result.has(target-arr[i])){
      return [arrs.get(target-nums[i]),i]
      }
      result.set(nums[i],i)
      }
      };
      +

      Map

      1
      2
      3
      4
      5
      6
      7
      8
      9
      function(arr, target) {
      let result = new Map()
      for(let i=0;i<arr.length;i++){
      if(result.has(target-arr[i])){
      return [result.get(target-nums[i]),i]
      }
      result.set(nums[i],i)
      }
      };

      假设有130个苹果,你我轮流拿,每次可拿1-5个,如何保证你拿到最后一个苹果

      巴什博奕嘛保证剩最后6个给对面取,先取者可必胜,第一次取4个,剩126个,对面随便取,取的时候保证一直剩余6的倍数,最后一定出现剩6个苹果的情况。

      +

      手动控制并发请求fetchWithLimit

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      function fetchWithLimit(urls, max, callback) {
      const urlCount = urls.length;
      const requestsQueue = [];
      const results = [];
      let i = 0;
      const handleRequest = (url) => {
      const req = fetch(url).then(res => {
      const len = results.push(res);
      if (len < urlCount && i + 1 < urlCount) {
      requestsQueue.shift();
      handleRequest(urls[++i])
      } else if (len === urlCount) {
      'function' === typeof callback && callback(results)
      }
      }).catch(e => {
      results.push(e)
      });
      if (requestsQueue.push(req) < max) {
      handleRequest(urls[++i])
      }
      };
      handleRequest(urls[i])
      }
    @@ -698,7 +699,7 @@

    算法题练习

    文章作者:陈宇(cosyer)

    发布时间:2020年04月23日 - 01:04

    -

    最后更新:2020年08月31日 - 20:08

    +

    最后更新:2020年09月08日 - 19:09

    原始链接:http://mydearest.cn/2020/%E7%AE%97%E6%B3%95%E9%A2%98%E7%BB%83%E4%B9%A0.html

    @@ -1002,7 +1003,7 @@

    +

    @@ -1047,7 +1048,7 @@

    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字

    diff --git "a/2020/\350\247\202\345\257\237\350\200\205\346\250\241\345\274\217VS\345\217\221\345\270\203\350\256\242\351\230\205\346\250\241\345\274\217.html" "b/2020/\350\247\202\345\257\237\350\200\205\346\250\241\345\274\217VS\345\217\221\345\270\203\350\256\242\351\230\205\346\250\241\345\274\217.html" index adda3e25b..fb3b970fb 100644 --- "a/2020/\350\247\202\345\257\237\350\200\205\346\250\241\345\274\217VS\345\217\221\345\270\203\350\256\242\351\230\205\346\250\241\345\274\217.html" +++ "b/2020/\350\247\202\345\257\237\350\200\205\346\250\241\345\274\217VS\345\217\221\345\270\203\350\256\242\351\230\205\346\250\241\345\274\217.html" @@ -975,7 +975,7 @@

    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字

    diff --git "a/2020/\351\235\242\350\257\225\351\227\256\351\242\230\351\233\206\351\224\246.html" "b/2020/\351\235\242\350\257\225\351\227\256\351\242\230\351\233\206\351\224\246.html" index 64f6812f1..1d7bb88d5 100644 --- "a/2020/\351\235\242\350\257\225\351\227\256\351\242\230\351\233\206\351\224\246.html" +++ "b/2020/\351\235\242\350\257\225\351\227\256\351\242\230\351\233\206\351\224\246.html" @@ -1049,7 +1049,7 @@

    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字

    diff --git "a/[1,2,3]\346\230\257JSON\345\220\227\357\274\237.html" "b/[1,2,3]\346\230\257JSON\345\220\227\357\274\237.html" index 62a53334e..edfd007f0 100644 --- "a/[1,2,3]\346\230\257JSON\345\220\227\357\274\237.html" +++ "b/[1,2,3]\346\230\257JSON\345\220\227\357\274\237.html" @@ -997,7 +997,7 @@

    总结
    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字

    diff --git a/about/index.html b/about/index.html index 9045cfe68..d474c72de 100644 --- a/about/index.html +++ b/about/index.html @@ -671,7 +671,7 @@

    关于

    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字
    diff --git "a/angular7\350\257\246\350\247\243.html" "b/angular7\350\257\246\350\247\243.html" index e3a214b90..7b4830315 100644 --- "a/angular7\350\257\246\350\247\243.html" +++ "b/angular7\350\257\246\350\247\243.html" @@ -1033,7 +1033,7 @@

    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字

    diff --git a/archives/2018/04/index.html b/archives/2018/04/index.html index 4f5078cf4..a57e2fefe 100644 --- a/archives/2018/04/index.html +++ b/archives/2018/04/index.html @@ -796,7 +796,7 @@

    - Blog总字数: 286.9k字 + Blog总字数: 288.0k字
    diff --git a/archives/2018/06/index.html b/archives/2018/06/index.html index 823ad88a8..fe3cf2d64 100644 --- a/archives/2018/06/index.html +++ b/archives/2018/06/index.html @@ -645,7 +645,7 @@