代码拉取完成,页面将自动刷新
{"meta":{"title":"毕竟几人真得鹿|不知终日梦为魚","subtitle":"","description":"","author":"打一架","url":"https://seeyooagain.gitee.io","root":"/beyond/"},"pages":[{"title":"关于页面","date":"2019-12-09T17:18:44.130Z","updated":"2019-12-09T17:18:44.130Z","comments":true,"path":"archives/index.html","permalink":"https://seeyooagain.gitee.io/archives/index.html","excerpt":"","text":"关于这一方面 那一方面 方方面面"},{"title":"关于页面","date":"2019-12-09T17:18:44.130Z","updated":"2019-12-09T17:18:44.130Z","comments":true,"path":"friends/index.html","permalink":"https://seeyooagain.gitee.io/friends/index.html","excerpt":"","text":"关于这一方面 那一方面 方方面面"},{"title":"关于页面","date":"2019-12-09T17:18:44.130Z","updated":"2019-12-09T17:18:44.130Z","comments":true,"path":"about/index.html","permalink":"https://seeyooagain.gitee.io/about/index.html","excerpt":"","text":"关于这一方面 那一方面 方方面面"},{"title":"python","date":"2019-12-09T17:19:37.121Z","updated":"2019-12-09T17:19:37.121Z","comments":true,"path":"about/about.html","permalink":"https://seeyooagain.gitee.io/about/about.html","excerpt":"","text":"python学习"},{"title":"关于页面","date":"2019-12-09T17:18:44.130Z","updated":"2019-12-09T17:18:44.130Z","comments":true,"path":"tags/index.html","permalink":"https://seeyooagain.gitee.io/tags/index.html","excerpt":"","text":"关于这一方面 那一方面 方方面面"},{"title":"关于页面","date":"2019-12-09T17:18:44.130Z","updated":"2019-12-09T17:18:44.130Z","comments":true,"path":"projects/index.html","permalink":"https://seeyooagain.gitee.io/projects/index.html","excerpt":"","text":"关于这一方面 那一方面 方方面面"}],"posts":[{"title":"javascript数组常见操作","slug":"javascript常见数组","date":"2019-12-24T12:25:49.962Z","updated":"2019-12-24T15:26:43.457Z","comments":true,"path":"2019/12/24/javascript常见数组/","link":"","permalink":"https://seeyooagain.gitee.io/2019/12/24/javascript%E5%B8%B8%E8%A7%81%E6%95%B0%E7%BB%84/","excerpt":"1、迭代Iteratefor..of循环for(const item of items) 循环遍历数组项 1const colors = ['blue','green','red'];2for(const color of colors){3 console.log(color)4}5// 'blue'6// 'green'7// 'red' 可以使用break语句停止迭代","text":"1、迭代Iteratefor..of循环for(const item of items) 循环遍历数组项 1const colors = ['blue','green','red'];2for(const color of colors){3 console.log(color)4}5// 'blue'6// 'green'7// 'red' 可以使用break语句停止迭代 for循环for(let i; i < array.length; i++) 使用递增的index变量循环遍历数组项 1const colors = ['blue','green','red'];2for(let index = 0;index < colors.length;index++){3 const color = colors[index];4 conole.log(color);5}6// 'blue'7// 'green'8// 'red' 可以使用break语句停止迭代 array.forEach()方法array.forEach(callback)方法通过callback在每个数组项上调用函数来遍历数组项 1const colors = ['blue','green','red'];2colors.forEach(function callback(value,index){3 console.log(value,index);4});5// 'blue',06// 'green',17// 'red',2 array.forEach(callback)调用callback3次 列出数组中的每一项不能使用break等终止迭代 2、Reducearray.reduce()方法array.reduce(callback[, initialValue])通过调用缩减callback函数来将数组缩减为一个值语法array.reduce(function(total, currentValue, currentIndex, arr), initialValue)| 参数 | 描述 || :——– | ——–: ||function(total,currentValue, currentIndex,arr)| 必须|total|必须,初始值, 或者计算结束后的返回值。||currentValue|必需。当前元素|currentIndex|可选。当前元素的索引|arr|可选。当前元素所属的数组对象。||initialValue|可选。传递给函数的初始值 | 1const numbers = [2, 0, 4];2function summarize(accumulator, number) {3 return accumulator + number;4}5const sum = numbers.reduce(summarize, 0);6sum; // => 6 第一步accumulator,用初始化0。然后,summarize在每个数组项上调用函数以累积数字总和。如果您跳过initialValue参数,则第一个数组项将成为初始值。 3、Maparray.map()方法array.map(callback)方法通过callback回调在每个数组项上使用调用结果来创建一个新数组 1const numbers = [1,2,3];2const newNumbers = numbers.map(function increment(number){3 return number + 1;4});5newNumbers;// => [2,3,4] Array.from()函数Array.from(arrayLike[, callback])方法通过callback在每个数组项上使用调用结果来创建一个新数组 1const numbers = [0, 2, 4];2const newNumbers = Array.from(numbers,3 function increment(number) {4 return number + 1;5 }6);7newNumbers; // => [1, 3, 5] Array.from() 创建一个新的映射数组 而不改变原始数组Array.from()更适合从类似数组的对象进行映射 4、Concatarray.concat方法array1.concat(array2,array3,…,arrayX) 1const heroes = ['Batman', 'Robin'];2const villains = ['Joker', 'Bane'];3const everyone = heroes.concat(villains);4everyone; // => ['Batman', 'Robin', 'Joker', 'Bane']5heroes.concat(villains)通过串联heroes和villains数组创建一个新数组。 array.concat() 创建一个新数组,而不改变原始数组array.concat(array1[, array2, …]) 接受多个数组以进行连接。 spread operator展开运算符您可以将spread操作符与数组文字一起使用来连接数组:[…array1, …array2]。让我们串联两个名称数组: 1const heroes = ['Batman', 'Catwoman'];2const villains = ['Joker', 'Bane'];3const names = [...heroes, ...villains];4names; // => ['Batman', 'Catwoman', 'Joker', 'Bane'] […arr1, …arr2, …arrN]:您可以使用扩展运算符连接所需数量的数组。 5、slicearray.slice方法语法array.slice(start, end)| 参数 | 描述 || :——– | ——–: ||start|可选。规定从何处开始选取。如果是负数,那么它规定从数组尾部开始算起的位置。也就是说,-1 指最后一个元素,-2 指倒数第二个元素,以此类推。||end|可选。规定从何处结束选取。该参数是数组片断结束处的数组下标。如果没有指定该参数,那么切分的数组包含从start到数组结束的所有元素。如果这个参数是负数,那么它规定的是从数组尾部开始算起的元素。|返回一个新的数组,包含从 start 到 end (不包括该元素)的 arrayObject 中的元素。 1const names = ['Batman', 'Catwoman', 'Joker', 'Bane'];2const heroes = names.slice(0, 2);3const villains = names.slice(2);4heroes; // => ['Batman', 'Catwoman']5villains; // => ['Joker', 'Bane'] 6、clone数组克隆spread operator展开运算符const clone = […array] 1const colors = ['white', 'black', 'gray'];2const clone = [...colors];3clone; // => ['white', 'black', 'gray']4colors === clone; // => false […colors]创建colors数组的副本。[…array] 创建一个浅表副本。 array.concat()[].concat(array)克隆的另一种方法array。 1const colors = ['white', 'black', 'gray'];2const clone = [].concat(colors);3clone; // => ['white', 'black', 'gray']4colors === clone; // => false [].concat(colors)创建colors数组的副本。[].concat(array) 创建一个浅表副本。 array.slice()array.slice()是关于克隆的另一种方法array。 1const colors = ['white', 'black', 'gray'];2const clone = colors.slice();3clone; // => ['white', 'black', 'gray']4colors === clone; // => false colors.slice()创建colors数组的副本。colors.slice() 创建一个浅表副本。 7、search数组查找array.includes()方法语法 arr.includes(searchElement)、arr.includes(searchElement, fromIndex)| 参数 | 描述 || :——– | ——–: ||searchElement|必须。需要查找的元素值。||fromIndex|可选。从该索引处开始查找 searchElement。如果为负值,则按升序从 array.length + fromIndex 的索引开始搜索。默认为 0。| 让我们来确定是否2与99存在于数字数组: 1const numbers = [1, 2, 3, 4, 5];2numbers.includes(2); // => true3numbers.includes(99); // => false numbers.includes(2)返回,true因为2存在于numbers数组中。numbers.includes(99)但是,false因为其中numbers不包含99。 array.find()方法array.indexOf()方法8、queryarray.every()方法array.some()方法9、filter数组过滤array.filter10、insert数组插入array.push()方法array.unshift()方法spread operator展开运算符11、remove数组移除array.pop方法array.shift()方法array.splice()方法spread operator12、empty数组清空array.length propertyarray.splice()方法13、fill数组填充array.fill()方法Array.from()函数14、flatten数组扁平化array.flat()方法15、sort数组排序array.sort()方法","categories":[],"tags":[]},{"title":"javascript中的无限大","slug":"javascript中的无限大","date":"2019-12-23T16:47:17.758Z","updated":"2019-12-23T18:07:34.537Z","comments":true,"path":"2019/12/24/javascript中的无限大/","link":"","permalink":"https://seeyooagain.gitee.io/2019/12/24/javascript%E4%B8%AD%E7%9A%84%E6%97%A0%E9%99%90%E5%A4%A7/","excerpt":"1、无限的定义Infinity和-Infinity都是number类型的特殊值 1typeof Infinity; // => 'number'2typeof -Infinity; // => 'number' Infinity是全局对象属性 例如在浏览器中 1window.Infinity; // => 'Infinity' 另外要注意Number函数具有2个属性 1Number.POSITIVE_INFINITY; // => Infinity2Number.NEGATIVE_INFINITY; // => -Infinity","text":"1、无限的定义Infinity和-Infinity都是number类型的特殊值 1typeof Infinity; // => 'number'2typeof -Infinity; // => 'number' Infinity是全局对象属性 例如在浏览器中 1window.Infinity; // => 'Infinity' 另外要注意Number函数具有2个属性 1Number.POSITIVE_INFINITY; // => Infinity2Number.NEGATIVE_INFINITY; // => -Infinity 2、无限的性质正无穷大InfinityInfinity大于任何有限数 看下面的例子 1Infinity > 100 // => ture2Infinity > Number.MAX_SAFE_INTEGER // => true3Infinity > Number.MAX_VALUE // => true Infinity在参与算术运算如加减乘除中用作操作数时 会产生有趣的效果 产生无限结果的运算1Infinity + 1; // => Infinity2Infinity + Infinity; // => Infinity3Infinity * 2; // => Infinity4Infinity / 2 // => Infinity52 / 0; // => Infinity 产生有限结果的运算110 / Infinity; // => 0 产生NAN的运算1Infinity / Infinity; // => NAN2Infinity % 2; // => NAN 负无穷大-Infinity-Infinity (负无穷大)小于任何有限数 让我们-Infinity与一些有限数字进行比较: 1-Infinity < 100; // => true2-Infinity < -Number.MAX_SAFE_INTEGER; // => true3-Infinity < -Number.MAX_VALUE; // => true 同时,负无穷小于正无穷: 1-Infinity < Infinity; // => true 当使用不同符号的操作数时,您可能最终以负无穷大: 1Infinity * -1; // => -Infinity2Infinity / -2; // => -Infinity3-2 / 0; // => -Infinity 3、检查无穷大无穷大等于相同符号的无穷大: 1Infinity === Infinity; // => true2-Infinity === -Infinity; // => true 由于不同的符号Infinity不等于-Infinity: 1Infinity === -Infinity; // => false JavaScript有一个特殊的功能Number.isFinite(value),用于检查提供的值是否有限: 1Number.isFinite(Infinity); // => false2Number.isFinite(-Infinity); // => false3Number.isFinite(999); // => true 4、无限用例当您要初始化涉及数字比较的计算时,无穷大值非常方便。例如,在数组中搜索最小值时: 1function findMin(array) {2 let min = Infinity;3 for (const item of array) {4 min = Math.min(min, item);5 }6 return min;7}8findMin([5, 2, 1, 4]); // => 1 该min变量初始化Infinity。在第for()一次迭代中,最小值成为第一项。 5、无限的陷阱解析数字将’Infinity’string解析parseFloat()为实际Infinity数字: 1parseFloat('Infinity'); // => Infinity 另一种选择是parseInt()解析整数。它不会重新确定’Infinity’为整数: 1parseInt('Infinity', 10); // => NaN JSON序列化JSON.stringify()将Infinity数字序列化为null。 1const worker = {2 salary: Infinity3};4JSON.stringify(worker); // => '{ "salary": null }' salary是Infinity。但是当字符串化为JSON时,”salary”将变为null。 最大数溢出Number.MAX_VALUE 是JavaScript中最大的浮点数。尝试使用比更大的数字Number.MAX_VALUE,JavaScript将该数字转换为Infinity: 12 * Number.MAX_VALUE; // => Infinity2Math.pow(10, 1000); // => Infinity 数学函数MathJavaScript 中名称空间的某些功能可以返回无数。这里有一些例子: 1const numbers = [1, 2];2const empty = [];3Math.max(...numbers); // => 24Math.max(...empty); // => -Infinity5Math.min(...numbers); // => 16Math.min(...empty); // => Infinity Math.max()当不带参数调用时-Infinity,Math.min()相应地返回Infinity。如果您尝试确定一个空数组的最大值或最小值,那可能会令人惊讶。这是一个有趣的数学讨论,为什么会发生这种情况。 6、总结InfinityJavaScript中的ins表示无限数的概念。任何有限数小于Infinity,任何有限数大于-Infinity。在JavaScript中比较无限值很容易:Infinity === Infinityis true。特殊函数Number.isFinite()确定提供的参数是否为有限数。Infinite在启动涉及数字比较的算法时,可以使用初始化变量。一个用例正在寻找数组的最小值。必须注意与Infinity分析从输入数字时:Number(‘Infinity’),parseFloat(‘Infinity’)返回的实际Infinity数量。序列化为时JSON.stringify(),无限数变为null。 翻译自https://dmitripavlutin.com/infinity-in-javascript/","categories":[],"tags":[]},{"title":"关于nodejs的一些","slug":"nodejs","date":"2019-12-12T15:00:14.698Z","updated":"2019-12-21T08:49:28.248Z","comments":true,"path":"2019/12/12/nodejs/","link":"","permalink":"https://seeyooagain.gitee.io/2019/12/12/nodejs/","excerpt":"1、nodejs不是新的语言,也不是框架,而是基于V8引擎的javascript运行时环境2、nodejs使得javascript不再局限于运行在浏览器这个宿主环境,而还可以运行在V8运行时","text":"1、nodejs不是新的语言,也不是框架,而是基于V8引擎的javascript运行时环境2、nodejs使得javascript不再局限于运行在浏览器这个宿主环境,而还可以运行在V8运行时","categories":[],"tags":[]},{"title":"HTTPS原理","slug":"HTTPS原理","date":"2019-12-12T14:23:11.911Z","updated":"2019-12-21T08:42:33.759Z","comments":true,"path":"2019/12/12/HTTPS原理/","link":"","permalink":"https://seeyooagain.gitee.io/2019/12/12/HTTPS%E5%8E%9F%E7%90%86/","excerpt":"1、SSL2、非对称加密3、CA证书 HTTPS的实现原理A、证书验证1、浏览器发起https请求2、服务器端返回https证书(包含了公钥)3、客户端验证证书合法性 B、数据传输1、证书验证合法 客户端本地生成随机数2、公钥加密随机数 传递给服务端3、服务端通过私钥对随机数解密4、服务端使用解密后的随机数构造对称加密算法 对服务端返回给客户端的内容进行加密传输","text":"1、SSL2、非对称加密3、CA证书 HTTPS的实现原理A、证书验证1、浏览器发起https请求2、服务器端返回https证书(包含了公钥)3、客户端验证证书合法性 B、数据传输1、证书验证合法 客户端本地生成随机数2、公钥加密随机数 传递给服务端3、服务端通过私钥对随机数解密4、服务端使用解密后的随机数构造对称加密算法 对服务端返回给客户端的内容进行加密传输 为什么数据传输使用对称加密 ?非对称加密效率低下,对存在大量交互的传输内容,并不适合使用非对称加密;https应用场景中,只有服务端保存了私钥。","categories":[],"tags":[]},{"title":"数组","slug":"array","date":"2019-12-07T11:53:09.458Z","updated":"2019-12-07T11:54:01.966Z","comments":true,"path":"2019/12/07/array/","link":"","permalink":"https://seeyooagain.gitee.io/2019/12/07/array/","excerpt":"","text":"数组","categories":[],"tags":[]},{"title":"测试页面","slug":"index","date":"2019-12-06T17:26:16.442Z","updated":"2019-12-06T17:27:33.020Z","comments":true,"path":"2019/12/07/index/","link":"","permalink":"https://seeyooagain.gitee.io/2019/12/07/index/","excerpt":"","text":"点点滴滴","categories":[],"tags":[]},{"title":"Hello World","slug":"hello-world","date":"2019-12-06T16:43:52.926Z","updated":"2019-12-06T16:43:52.926Z","comments":true,"path":"2019/12/07/hello-world/","link":"","permalink":"https://seeyooagain.gitee.io/2019/12/07/hello-world/","excerpt":"","text":"Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick StartCreate a new post1$ hexo new \"My New Post\" More info: Writing Run server1$ hexo server More info: Server Generate static files1$ hexo generate More info: Generating Deploy to remote sites1$ hexo deploy More info: Deployment","categories":[],"tags":[]}]}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。