Ununennium
V2EX  ›  问与答

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

  •  
  •   Ununennium · Aug 20, 2020 · 1682 views
    This topic created in 2110 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   ·   2666 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 11:31 · PVG 19:31 · LAX 04:31 · JFK 07:31
    ♥ Do have faith in what you're doing.