What Does "(e)" Mean in JavaScript? - Event Handler Object Explained

What Does "(e)" Mean in JavaScript? - Event Handler Object Explained

dcode

2 года назад

66,545 Просмотров

The one thing that always confused me when I was learning JavaScript was what exactly the "e" or "ev" was when using events on things like button clicks or mouseovers - in this video, we take a look at how this object is useful for JavaScript coding.

For your reference, check this out:
https://developer.mozilla.org/en-US/docs/Web/API/Event

🏫 My Udemy Courses - https://www.udemy.com/user/domenic-corso/
🎨 Download my VS Code theme - https://marketplace.visualstudio.com/items?itemName=dcode.dcode-theme
💜 Join my Discord Server - https://discord.gg/TXMQyvbpcA
🐦 Find me on Twitter - https://twitter.com/dcodeyt
💸 Support me on Patreon - https://www.patreon.com/dcode
📰 Follow me on DEV Community - https://dev.to/dcodeyt
📹 Join this channel to get access to perks - https://www.youtube.com/channel/UCjX0FtIZBBVD3YoCcxnDC4g/join

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!

#dcode #javascript

Тэги:

#js_events_tutoria; #javascript_events #how_to_use_javascript_events #javascript_mousedown_event #javascript_mouseup_event #javascript_click_event #javascript_double_click_event #javascript_button_click_event #javascript_event_handlers #what_are_javascript_events #what_are_javascript_event_handlers #what_are_event_listeners_in_javascript #addEventListener_tutorial #javascript_location_of_mouse #event_target_javascript
Ссылки и html тэги не поддерживаются


Комментарии:

@ashishbhardwaj9390
@ashishbhardwaj9390 - 18.09.2023 16:28

🐤🎉

Ответить
@basmong
@basmong - 03.09.2023 12:33

Here it is. If you call it not an event ("e" or "event"), but an object, then everything immediately becomes clearer. This is an event OBJECT! And this object has properties: .target, .ctrlKey, etc.
Thanks for the video.

Ответить
@adibpathan41833
@adibpathan41833 - 21.07.2023 20:55

thank you so much 💟

Ответить
@TheMjukost
@TheMjukost - 20.07.2023 18:04

Worst video ever. Logged e to the console and checked mdn docs. Damn, never would have thought of that.

Ответить
@naugustus939
@naugustus939 - 08.07.2023 19:32

Out of all the videos. I found this to be easiest and straight to the point. Thank you sir.

Ответить
@iambrijeshtoo
@iambrijeshtoo - 12.06.2023 19:03

Thank you ❤

Ответить
@rahulshekar907
@rahulshekar907 - 05.05.2023 11:54

This was very confusing to me. Thanks a lot for clearing

Ответить
@user-jr5tz2hc4f
@user-jr5tz2hc4f - 02.04.2023 21:51

thank you!

Ответить
@hwanhoonkim5576
@hwanhoonkim5576 - 04.02.2023 04:12

Cool theme, can I know the name of the theme please?

Ответить
@valdemaraspetrutis6237
@valdemaraspetrutis6237 - 30.01.2023 22:24

Brilliant

Ответить
@jibonislamgame
@jibonislamgame - 13.01.2023 19:56

Helpful

Ответить
@DesignToDeploy
@DesignToDeploy - 10.01.2023 17:58

I am searching for this finally I found it. Thank u so much.

Ответить
@netsaosa4973
@netsaosa4973 - 05.11.2022 21:45

E

Ответить
@christopherlangley695
@christopherlangley695 - 23.09.2022 00:36

Thank you, this video made it easier to grasp the concept behind the event object

Ответить
@daneshtolani6136
@daneshtolani6136 - 20.09.2022 13:45

Great explaination, thanks 👍

Ответить
@kiler62
@kiler62 - 18.09.2022 16:05

Very heplful, thanks so much :)

Ответить
@sudiptamukherjee8216
@sudiptamukherjee8216 - 16.08.2022 09:35

This video is really help me...

Ответить
@EnzoAuditore
@EnzoAuditore - 16.08.2022 00:48

thanks mate

Ответить
@Konslufius
@Konslufius - 28.07.2022 23:39

So to break it down for a stupid like me. Everything that is an event and is performed gets stored in a bundle of informations. In this case the e object.

Ответить
@macfitton5624
@macfitton5624 - 22.07.2022 00:34

Kinda confusing video, the conditional statement if(e.ctrlKey) doesn't actually check if the ctrl key is being pressed down or not, just if that property exists at all with the event object, regardless of it's Boolean value.

Ответить
@daprone4949
@daprone4949 - 14.07.2022 00:23

Thank you bro, I was stuck with this, now you explained.

Ответить
@karek9593
@karek9593 - 04.06.2022 17:25

you solved my code problem by uploading this short video just great 😎

Ответить
@dcode-software
@dcode-software - 30.05.2022 13:13

As a few people have pointed out, the parameter "e" can be named anything. Other common names for the event object parameter is "ev", "evt" or "event".

Ответить
@ClarkeDesign
@ClarkeDesign - 30.05.2022 10:02

Would have been nice to explain too why "e". Can it be any other variable name, I assume that 'e' is used for simplicity, shorthand and laziness. but it could be "event", or "eventProperties" or "banana" - as the developer sees fit.

Ответить
@dennishofke
@dennishofke - 30.05.2022 01:04

What an incredibly bad video. What you're explaining in this video is what's inside the parameter passed to the callback function you provide to an event listener. But in your title you say that this is always the case when you see (e) in some code. Even in this case it 'e' can be named no matter what, some people like to name it 'event' etc...

Ответить
@TheUnown4
@TheUnown4 - 27.05.2022 17:46

Thank you, perfect explanation

Ответить
@tomasnovakovic1309
@tomasnovakovic1309 - 21.05.2022 18:46

great explanation!

Ответить
@christianarroyo3033
@christianarroyo3033 - 14.05.2022 04:01

That was awesome. Thank you. When you showed console.log(e) and it was an object! my mind was blown

Ответить
@alidakhil3554
@alidakhil3554 - 29.04.2022 10:12

Brilliant as usual.

Ответить
@abc-hl1pw
@abc-hl1pw - 21.04.2022 20:48

(e) contain informations about event

Ответить
@KHuynh
@KHuynh - 03.04.2022 09:31

thank you

Ответить
@georgegeorgio70
@georgegeorgio70 - 13.03.2022 00:01

I get a pointerEvent instead of mouseEvent is that wrong?

Ответить
@khlfff2
@khlfff2 - 09.03.2022 05:08

Great video man! Made this a lot clearer for me. Subscribed!

Ответить
@parmesanogood4393
@parmesanogood4393 - 26.02.2022 18:07

I'm spanish speaking, but i understood almost all you said.

Ответить
@alicanyildirim3615
@alicanyildirim3615 - 06.02.2022 03:11

Thank you soo much!!🙏🏼

Ответить
@fragrantbloom
@fragrantbloom - 16.01.2022 04:49

thank you!

Ответить
@lunasoleil2827
@lunasoleil2827 - 05.01.2022 18:30

Thank you! So concise!

Ответить
@togrulmustafabayat
@togrulmustafabayat - 10.12.2021 13:04

My Supreme Leader Thanks for all!

Ответить
@kelofarrar
@kelofarrar - 01.12.2021 17:04

Great video and advice! I was a little hazy on my full understanding of the Event object , now I full understand it!

Ответить
@thydevdom
@thydevdom - 20.11.2021 21:57

This makes things so much clearer

Ответить
@JoeyGuess
@JoeyGuess - 12.11.2021 14:26

Wow, very well explained. This helped a lot. Thank you!

Ответить
@rymkheliancorporation9649
@rymkheliancorporation9649 - 25.10.2021 10:17

is this deprecated?

Ответить
@redheadrusskie
@redheadrusskie - 17.09.2021 21:34

Thanks!!

Ответить
@prathvisingh8288
@prathvisingh8288 - 07.09.2021 10:02

Crystal clear explanation. CRYSTAL!

Ответить
@Pareshbpatel
@Pareshbpatel - 17.08.2021 10:51

Nice tutorial on the basics of Events in JavaScript. Thanks, Dom

{2021-08-17}

Ответить
@jrupp2823
@jrupp2823 - 03.08.2021 19:58

i love you

Ответить
@erfelipe
@erfelipe - 01.08.2021 00:28

Thanks

Ответить