Javascript Scope
Local Javascript Variables
// code here can not use material function myFunction() { var material = "sand"; // code here can use material }
Global Javascript Variables
var material = "sand"; // code here can use material function myFunction() { // code here can use material }
Automatically Global Variables
// code here can use material function myFunction() { material = "sand"; // code here can use material }