S
S
serking772018-03-19 15:25:13
JavaScript
serking77, 2018-03-19 15:25:13

What does this syntax mean?

piece of code

bot.action('delete', ({ deleteMessage }) => deleteMessage())

Without going into the purpose of the methods, I would like to understand for myself
why the object is specified as a function argument and how it is possible to call a method that is not bound to an object ...
is this destructuring? can prompt what to esteem on syntax.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
0
0xD34F, 2018-03-19
@serking77

is this destructuring?

Yes .

A
Alexey Ukolov, 2018-03-19
@alexey-m-ukolov

This is a destructuring.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question