title: Debugging current file in VS Code
body: <p>I am writing javascript and am currently doing simple exercises/programs.  At times, I wish to run my file for testing purposes.  I am aware I could create an <code>HTML</code> file and do this within the console.  In Sublime, there exists a way to "build" the current file and immediately see the results (say, whatever is sent to console.log). </p>
  
  <p>With VS Code, it seems that for every file I want to "build"/debug in this manner, I must manually change the <code>launch.json</code> file to reflect the name of the current program.  </p>
  
  <p>I have been researching a way around this, and I learned that there are variables like <code>${file}</code> , but when I use that in the <code>launch.json</code> "program" attribute, for example: </p>
  
  <pre><code>"program": "${workspaceRoot}/${file}"
  </code></pre>
  
  <p>with or without the <code>workspaceRoot</code> part, I get the following error: </p>
  
  <pre><code>Attribute "program" does not exist" (file name here). 
  </code></pre>
  
  <p>Am I missing a simple way to accomplish this, or must I keep editing <code>launch.json</code> every time I want to run the file? </p>
  
  <p>Thanks in advance! </p>