Always return on events is faster, but why?
1–10 of 52 posts
Re: Always return on events is faster, but why?
#2Doesn't just calling return from an event equate to returning boolean false, which means you are invoking the effects of preventDefault() and stopImmediatePropagation() thus explaining why with return it's faster as the event stops bubbling immediately?
Re: Always return on events is faster, but why?
#3I posted it on the page as well: Doesn't just calling return from an event equate to returning boolean false, which means you are invoking the effects of preventDefault() and stopImmediatePropagation() thus explaining why with return it's faster as the event stops bubbling immediately?
Re: Always return on events is faster, but why?
#4Re: Always return on events is faster, but why?
#5Re: Always return on events is faster, but why?
#6Doesn't a return without argument return false and thus have the same effect as preventDefault()? That would explain the difference, since the events are not "bubbling up".
Re: Always return on events is faster, but why?
#7I posted it on the page as well: Doesn't just calling return from an event equate to returning boolean false, which means you are invoking the effects of preventDefault() and stopImmediatePropagation() thus explaining why with return it's faster as the event stops bubbling immediately?
No. It equates to returning undefined, which is the same as having no return statement at all.
Re: Always return on events is faster, but why?
#8Doesn't a return without argument return false and thus have the same effect as preventDefault()? That would explain the difference, since the events are not "bubbling up".
Re: Always return on events is faster, but why?
#9I posted it on the page as well: Doesn't just calling return from an event equate to returning boolean false, which means you are invoking the effects of preventDefault() and stopImmediatePropagation() thus explaining why with return it's faster as the event stops bubbling immediately?
No. It equates to returning undefined, which is the same as having no return statement at all.
Re: Always return on events is faster, but why?
#10Doesn't a return without argument return false and thus have the same effect as preventDefault()? That would explain the difference, since the events are not "bubbling up".