getElementsByTagName is much faster than querySelectorAll

2019-08-31

According to the section What is a Pattern? of the book Learning JavaScript Design Patterns by Addi Osmani: https://addyosmani.com/resources/essentialjsdesignpatterns/book/#whatisapattern

So, if selecting by class, this

const listItems = list.getElementsByTagName('list-item');

would be preferable to

const listItems = list.querySelector('.list-item');