V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Ununennium
V2EX  ›  问与答

=>箭头函数的返回值在哪里获取

  •  
  •   Ununennium · Aug 20, 2020 · 1612 views
    This topic created in 2077 days ago, the information mentioned may be changed or developed.

    JavaScript 请问,x=>xx console.log()填入什么才能获取到 xx 的值?

    如果填 console.log(x=>xx),则会输出 x=>xx,但是我需要的是 x*x 的值 谢谢!

    2 replies    2020-08-20 11:20:41 +08:00
    forgcode
        1
    forgcode  
       Aug 20, 2020 via iPhone
    (x=> x*x)(2)
    Ununennium
        2
    Ununennium  
    OP
       Aug 20, 2020
    @forgcode 谢谢兄弟,明白了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2654 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 16:01 · PVG 00:01 · LAX 09:01 · JFK 12:01
    ♥ Do have faith in what you're doing.