The JavaScript 'Comma Operator'

preview_player
Показать описание
Have you ever heard of this comma operator in JavaScript, and do you know what it does?

Prepping for your frontend interviews? Use code "conner" for a discount on my product FrontendExpert:

Рекомендации по теме
Комментарии
Автор

"Javascript is the best language!"

cazek
Автор

wow man please please please keep uploading tricky videos on js this will help us a lot to be unique and to crack interviews.

vaishnomatabhaktamandali
Автор

What’s the point if the last value only gets returned? Can you return any of the other values with a[]

curtmastor
Автор

That's interesting. But I am still a bit confused. Does it return only the last value or return consecutively 1, 2, 3. I really hope it is not the case since 'a' is a const.

facelessvoid
Автор

What could be the real world application of that?

sudidav
Автор

I think I saw this operator when browsing some JS vendor, I was wondering how this would even work lol

Raaampage
Автор

Javascript is so confusing...what even is the purpose of this operator?

Bored-Panda
Автор

It's not a tuple it's just JavaScript

rafaelbarreto
Автор

Funny how JavaScript "execute" a single number

emmanuellmiqueletti
Автор

Yeah I would love incorrect program some thing that is accepted by some goofy ass operator and constantly battle against implicit string conversions.
good language indeed

caiovinicius