Does the href and target variables have to be declared in that specific order?
no, attributes are not order specific.
Is it mandatory that the target attribute be written after the href attribute or it doesn’t matter, it functions the same either way?
I’m pretty sure that you don’t have to include the target attribute, it’s just good practice to make determinations about how the browser will open a link you insert. If you don’t specify it, I’m sure browsers have some kind of default link-opening behavior.
It is not mandatory, but like the article stated that you may want the person to come back to your page. Without the target attribute the link will open the new page in your same tab. If the person closes the tab they also close your page. Opening it in a new tab will make sure they come back to your page after they close out the other tab.