I would like to know what is more appropriate to do if I really need a good performance for my app. I'm programming cross-platform apps via PhoneGap and the way I code is very crucial.
Which is more appropriate:
document.getElementbyID('id').addEventListener()
or
var id = document.getElementbyID('id');
id.addEventListener();
and how can I use the keyword "delete" to improve the performance of my app?
According to this test i just made on jsperf.com, document.getElementbyID('id').addEventListener() seems to be the fastest way. - in Chrome on Mac OS X.
Try it on the desired browsers, and edit the test to add/remove features such as the delete you were talking about.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With