awesome-coding-js icon indicating copy to clipboard operation
awesome-coding-js copied to clipboard

Algorithms and data structures implemented in JavaScript, with detailed explanations and tutorials

Results 19 awesome-coding-js issues
Sort by recently updated
recently updated
newest added

call的代码实现写的有漏洞,应该改为如下代码 function fn1() { console.log(this, 1); } Function.prototype.myCall = function (context = window, ...args) { if (this === Function.prototype) { return undefined; // 用于防止 Function.prototype.myCall() 直接调用 } context = Object(context);...

这个方法不能区分1和’1‘,建议换成Map,或者key上面拼一个类型上去。

```js let arr = [2, 3, 11, 4] let r = arr.sort((a, b) => { return b % 2 - a % 2 }) console.log(r) ```

递归算法:好像写错了,解法思路是对的,但是运行就报错, 运行环境:vscode集成leetcode插件 ``` /* * @lc app=leetcode.cn id=230 lang=javascript * * [230] 二叉搜索树中第K小的元素 */ /** * Definition for a binary tree node. * function TreeNode(val) { * this.val = val;...

```js // 4.挂载回调函数 window[cbFuncName] = function (data) { callback(data); // 处理完回调函数的数据之后,删除jsonp的script标签 document.body.removeChild(scriptEle); delete window[cbFuncName] } ```

https://www.conardli.top/docs/JavaScript/%E5%8D%95%E4%BE%8B%E6%A8%A1%E5%BC%8F.html 开头的 ”在合适的时候才创建对像“ 应该是 对象 而不是对像

深拷贝中的cloneOtherType方法是否有误? new Ctr(tar); 如果这个tar是new Boolean(false)等,new Ctr(tar) 这样得到的值为true... (好像只有这一个特例....