Ununennium
V2EX  ›  问与答

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

  •  
  •   Ununennium · Aug 20, 2020 · 1702 views
    This topic created in 2125 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   ·   5959 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 03:34 · PVG 11:34 · LAX 20:34 · JFK 23:34
    ♥ Do have faith in what you're doing.