When assigning an identifier, JavaScript goes through exactly the same process to retrieve this identifier, except that if it is not found in the "global scope", it will create the "variable" in the scope where it was created. As a consequence, a variable never declared will be global, if assigned. Declaring a variable (with the keyword codice_2) in the "global scope" (i.e. outside of any function body (or block in the case of let/const)), assigning a never declared identifier or adding a property to the "global object" (usually "window") will also create a new global variable.