With codice_2, codice_3, and codice_4 statements, only the declaration is hoisted; assignments are not hoisted. Thus a statement in the middle of the function is equivalent to a declaration statement at the top of the function, and an assignment statement at that point in the middle of the function. This means you cannot access values before they are declared; forward reference is not possible. With codice_2 a variable's value is codice_14 until it is initialized. Variables declared with codice_3 or codice_4 cannot be accessed until it is initialized, so referencing the variable will cause an error.