Z
Z
zekohina2016-11-21 04:27:01
JavaScript
zekohina, 2016-11-21 04:27:01

Why is this being done?

Digging into the code of one library on js, I noticed such strange lines:
50e5e84a10754f09a7f2468013e0caf1.png
Specifically, this confused me:
(0, _typeof3.default)(attributes)
Googling a little, I realized that there is such an operator as a comma that executes an expression in order and returns the last one. Those. this expression will be equivalent to this: _typeof3.default(attributes)
But why is this being done?
PS There is a suspicion that this is an automatically generated code.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Aves, 2016-11-21
@zekohina

stackoverflow.com/questions/32275135/why-does-babe...

V
Vitaly, 2016-11-21
@vitali1995

Very similar to ES6 generated code -> ES5
Bublé
What is Bublé

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question