So im about to start Tribute Page project soon, i went trough intro of CodePen, it wrote <h1>Hello World</h1> and after that in CSS it styled body’s colour and then in JavaScript it wrote:
Didn’t you write this? If you just copied it from somewhere, you really don’t want to do that. It means creating a Frankenstein page that you don’t understand.
In answer to your question, getElementsByTagName() returns an array.
document.getElementsByTagName() will get ALL of the tags by the name that is passed to it. In the example you gave, if there were seven H1 tags on the page, all of them would be gathered in a kind of array (it’s technically an HTML Collection).
Before you start using JavaScript in your Tribute page project, you should probably wait until you have actually finished the Basic JavaScript section of Free Code Camp. This will enable you to understand what [0] means in the above code.
I already have finnished it, but basics didnt cover what 0 means when used in document.getElementBy… code, i actually thought it could be counting from 0,1,2,3 etc… but i wanted to make sure what it was 100%.