title: NodeJS SyntaxError: Unexpected token '.'
body: <p>Beginner to Node JS and NPM. The following code throws a Syntax error and can't figure out the issue.</p>
  <p>Node version: v12.18.3
  NPM version: 7.15.1</p>
  <p>Error</p>
  <pre><code>LayerObj.options?.[&quot;displayName&quot;] != undefined
                         ^
  
  SyntaxError: Unexpected token '.'
      at wrapSafe (internal/modules/cjs/loader.js:1053:16)
      at Module._compile (internal/modules/cjs/loader.js:1101:27)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
      at Module.load (internal/modules/cjs/loader.js:985:32)
      at Function.Module._load (internal/modules/cjs/loader.js:878:14)
      at Module.require (internal/modules/cjs/loader.js:1025:19)
      at require (internal/modules/cjs/helpers.js:72:18)
      at Object.&lt;anonymous&gt; (/Applications/MAMP/htdocs/nft-generators/hashlips_art_engine-main/index.js:2:39)
      at Module._compile (internal/modules/cjs/loader.js:1137:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
  </code></pre>
  <p>Code</p>
  <pre><code>const layersSetup = (layersOrder) =&gt; {
    const layers = layersOrder.map((layerObj, index) =&gt; ({
      id: index,
      elements: getElements(`${layersDir}/${layerObj.name}/`),
      name:
        layerObj.options?.[&quot;displayName&quot;] != undefined
          ? layerObj.options?.[&quot;displayName&quot;]
          : layerObj.name,
      blend:
        layerObj.options?.[&quot;blend&quot;] != undefined
          ? layerObj.options?.[&quot;blend&quot;]
          : &quot;source-over&quot;,
      opacity:
        layerObj.options?.[&quot;opacity&quot;] != undefined
          ? layerObj.options?.[&quot;opacity&quot;]
          : 1,
      bypassDNA:
        layerObj.options?.[&quot;bypassDNA&quot;] !== undefined
          ? layerObj.options?.[&quot;bypassDNA&quot;]
          : false,
    }));
    return layers;
  };
  </code></pre>