Ununennium
V2EX  ›  问与答

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

  •  
  •   Ununennium · Aug 20, 2020 · 1976 views
    This topic created in 2283 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
    forgcode
    Aug 20, 2020 via iPhone
    1
    (x=> x*x)(2)
    Ununennium
    Ununennium
    OP
    Aug 20, 2020
    2
    @forgcode 谢谢兄弟,明白了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   931 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 20:03 · PVG 04:03 · LAX 12:03 · JFK 15:03
    ♥ Do have faith in what you're doing.