title: JavaScript && Operator used for returns
body: <p>I am working understanding a JavaScript library and I came across this statement:</p>
  
  <p><code>const assetsManifest = process.env.webpackAssets &amp;&amp; JSON.parse(process.env.webpackAssets)</code></p>
  
  <p>Then later on in the library, it uses the <code>assetsMannifest</code> like an object e.g.</p>
  
  <p><code>assetsManifest['/vendor.js']</code></p>
  
  <p>I thought the <code>&amp;&amp;</code> operator was only used to return <code>boolean</code> values in logical checks. Can someone explain to me what is going on here?</p>
  
  <p>Many thanks,</p>
  
  <p>Clement</p>