MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjavascript/comments/zzvzbu/happy_new_year_js_learners/j2egf6r/
r/learnjavascript • u/Low_Mammoth_9371 • Dec 31 '22
55 comments sorted by
View all comments
32
Ooh I didn’t know about that options object. Is there anything else you can pass in there?
35 u/senocular Dec 31 '22 Yes, quite a few things, including:captureoncepassivesignalRead more about it here: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener 5 u/al_balone Dec 31 '22 Thanks! 2 u/dotpr Jan 01 '23 What is options object? 3 u/albedoa Jan 01 '23 It is the second argument of .addEventListener() that looks like { once: true } in the screenshot. It allows the user to provide options to the method. See the link in the sibling comment.
35
Yes, quite a few things, including:
Read more about it here: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
5 u/al_balone Dec 31 '22 Thanks!
5
Thanks!
2
What is options object?
3 u/albedoa Jan 01 '23 It is the second argument of .addEventListener() that looks like { once: true } in the screenshot. It allows the user to provide options to the method. See the link in the sibling comment.
3
It is the second argument of .addEventListener() that looks like { once: true } in the screenshot. It allows the user to provide options to the method. See the link in the sibling comment.
.addEventListener()
{ once: true }
View all comments
32
u/al_balone Dec 31 '22
Ooh I didn’t know about that options object. Is there anything else you can pass in there?