title: Can a function take an argument, and declare it as a global variable?
body: <p>Is it possible in javacsript, to have a function take an argument, and declare it as a global variable? For example, I know that this does not work, but I'm just curious if there's an alternative that works:</p>
  
  <pre><code>function newVar(n){
    n = "I'm a global variable"; 
  }
  
  newVar("workPls");
  console.log(workPls);  //Error: workPls is not defined
  </code></pre>