• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

mandyGuan12

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

2024年9月5日

力扣面试150题经典

摘要: 88. 合并两个有序数组 思路: 比较两个数组中最大的数(数组是非递减的), 选取大的那个, 从nums1的最后边赋值. /** * @param {number[]} nums1 * @param {number} m * @param {number[]} nums2 * @param {num 阅读全文

posted @ 2024-09-05 22:56 番茄仔Mandy 阅读(76) 评论(0) 推荐(0)

闭包closure

摘要: 先理解:作用域、作用域链、函数作用域以及变量对象 . . 给一段代码: var global; function a() { var aa = 123 function b() { aa = 111 console.log(aa) } // b() return b } var res = a() 阅读全文

posted @ 2024-09-05 21:49 番茄仔Mandy 阅读(19) 评论(0) 推荐(0)

手写bind

摘要: <script> Function.prototype.myBind = function (thisArg, ...args) { // 返回一个绑定了this的新函数 return (...args2) => this.call(thisArg, ...args, ...args2) } con 阅读全文

posted @ 2024-09-05 19:07 番茄仔Mandy 阅读(12) 评论(0) 推荐(0)

手写apply

摘要: Function.prototype.myApply = function (thisArg, argArray) { const fn = Symbol('fn') thisArg[fn] = this const res = thisArg[fn](...argArray) delete thi 阅读全文

posted @ 2024-09-05 18:51 番茄仔Mandy 阅读(14) 评论(0) 推荐(0)

手写call方法

摘要: <script> // <!-- 实现mycall方法, 功能和调用形式与call一致 --> // 原型定义一个mycall方法, 大家都能调用 Function.prototype.mycall = function (thisArg, ...argN) { // console.log('my 阅读全文

posted @ 2024-09-05 16:41 番茄仔Mandy 阅读(16) 评论(0) 推荐(0)

js中的this

摘要: 开启严格模式:'use strict' //放在全局最上方or函数内部最顶部 全局模式下: 严格模式和非严格模式 this -> window 函数内部中: 严格模式: this -> undefined 非严格模式: this -> window 对象方法调用: 严格模式和非严格模式 this - 阅读全文

posted @ 2024-09-05 15:30 番茄仔Mandy 阅读(7) 评论(0) 推荐(0)

 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3