Skip to content
小飞侠
  • 首页
  • 小程序
  • uniapp
  • vue
  • APICloud
  • 其他
菜单

博客

  1. 首页>
  2. 其他>
  3. 实现add(2, 5); // 7 add(2)(5); // 7

实现add(2, 5); // 7 add(2)(5); // 7

  • Post author:xfxia
  • Post published:2023年10月16日
  • Post category:其他


 var add = function(x,r) {
        if(arguments.length == 1){
            return function(y) { return x + y; };
        }else{
            return x+r;
        }
    };
    console.log(add(2)(5));
    console.log(add(2,5));

控制台输出测试:

7,

7


你可能也喜欢

jSON学习拓展:如何把一个json对象赋值给另一个json数组?

使用 ES-Hadoop 将 Spark Streaming 流数据写入 ES

tablayout 增加数字小标,如何在TabLayout中增加选项卡的图标大小

VSCode 路径自动补全插件

SpringBoot请求返回字符串中文乱码,修改默认StringHttpMessageConverter配置

基于opencv的c++图像处理(图像读取、显示以及保存)

大众mib官方固件更新_大众集团MQB平台之 电器系统详解

VMWare centOS虚拟机黑屏

GAN系列之动漫风格迁移AnimeGAN2

自定义指令 v-clickoutside 使用方法

UML基本架构建模--图概述

SpringBoot整合redis集群 ,redis集群搭建(windows版),redis5.x

gitlab服务器显示错误的http url

c语言:从键盘输入两个正整数,求其最大公约数和最小公倍数

idea 启动模块时报错:Error running GatewayApplication. Command line is too long. Shorten the command line vi

stm32——定时器中断控制步进电机

清晰weblog日志,过滤不合法的记录

RedisTemplate相关API

24位BMP文件读取、BMP文件转灰度图(附c/c++代码+详细注释)

超类Object和泛型类?的区别

目录

  • APICloud (3)
  • golang (228)
  • java (8,236)
  • linux (4,002)
  • mysql (2,800)
  • php (1,070)
  • python (5,439)
  • solidity (25)
  • uniapp (235)
  • vue (2,463)
  • 其他 (88,233)
  • 小程序 (801)

文章归档

  • 2023年十二月 (1872)
  • 2023年十一月 (477)
  • 2023年十月 (17371)
  • 2023年九月 (44974)
  • 2023年八月 (26399)
  • 2023年七月 (14793)
  • 2023年六月 (1)
  • 2023年五月 (2186)
  • 2023年四月 (3838)
  • 2023年三月 (1544)
  • 2023年二月 (3)
  • 2023年一月 (4)
  • 2022年十二月 (3)
  • 2022年十一月 (36)
  • 2022年十月 (16)
  • 2022年九月 (8)
  • 2021年九月 (1)
  • 2020年九月 (6)
  • 2020年八月 (5)

标签

Aave (1) cosmos (6) defi (255) flag (27) gitee (1) github (1) golang (234) java (8234) linux命令 (82) List (1) map (1115) mysql (3093) npm (237) tendermint (6) uuid (43) vant (64) vmware (270) 区块链 (63) 合约 (37) 小程序版本更新 (3)
  • 首页
  • 小程序
  • uniapp
  • vue
  • APICloud
  • 其他
Copyright xfxia.com 鲁ICP备19024253号-2
关闭菜单