ps. second example is not valid, in Vanilla JS you do it like this:
document.getElementsByTagName('p').filter(function(el) { el.innerHTML = 'Hello.'; });
Array.prototype.forEach.call(document.getElementsByTagName('p'), function(el) { el.innerHTML = 'Hello.'; });
TypeError: document.getElementsByTagName("p").filter is not a function
Because you don't get an array, only something array-like.
ps. second example is not valid, in Vanilla JS you do it like this: