Why do tutorials teach us to get an element's property in two statements such as this:
var sample = document.getElementById("sample");
var mySample = sample.value;
Instead of doing it all in one statement like this?
var mySample = document.getElementById("sample").value;
I understand that if you needed to access several different properties of the same element, it would result in less code and also make it easier to read but why do people do this even when there's only one property being accessed?