title: How can I find out if an ES6 value is var / const / let after it is declared?
body: <p>I know I can find out if a value is <code>var</code> <code>const</code> or <code>let</code> by looking at where it is declared. However I am wondering - mainly for debugging, developing JS compilers, and academic interest - if it is possible to find out the immutability / scope of a variable (var / const / let-ness) after it has been created.</p>
  
  <p>ie </p>
  
  <pre><code>doThing(something)
  </code></pre>
  
  <p>Would return</p>
  
  <pre><code>let
  </code></pre>
  
  <p>Or equivalent. Like we can determine types with <code>typeof</code> or <code>something.constructor.name</code> for constructors.</p>