🍪🧁🍧
摘要: 非严格模式下 在 浏览器 环境中,全局对象是 window。 在 Node.js 环境中,全局对象是 global globalThis.name='martin' 严格模式下 this是undefined 函数this永远指向最后调用他的对象 改变this指向 apply和call都只是临时改变一 阅读全文
posted @ 2025-03-17 21:10 不想吃fun 阅读(10) 评论(0) 推荐(0)
摘要: arr.flat(depth) @parame depth — The maximum recursion depth默认1 ES5 function flatten(arr){ let n=arr.length let result=[] for(let i=0;i<n;i++){ if(Arra 阅读全文
posted @ 2025-03-17 00:32 不想吃fun 阅读(5) 评论(0) 推荐(0)
摘要: 矩阵置0 //O(m*n) O(m+n) var setZeroes = function(matrix) { let row=[] let col=[] let n=matrix.length let m=matrix[0].length for(let i=0;i<n;i++){ for(let 阅读全文
posted @ 2025-03-17 00:06 不想吃fun 阅读(12) 评论(0) 推荐(0)