meaning of the Arrow function

Asked 1 years ago, Updated 1 years ago, 22 views

I see the following way of writing the Arrow function, but I don't know what it means.
Could you tell me the meaning of this Arrow function?

.then(server=>{
    console.log("server", server);

    return Promise.all([[]
        server.getPrimaryService(this.BUTTON_SERVICE_UUID)
    ]);
})

javascript

2022-09-30 18:14

1 Answers

Arguments in the Arrow function do not need to be parentheses if there is only one argument, so

.then(server)=>{
   // 
})

Same as


2022-09-30 18:14

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.