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