Determine if the JS environment has optional chaining support.
var hasOptionalChaining = require('has-optional-chaining');
hasOptionalChaining() === true; // if the environment has native optional chaining support.
Simply clone the repo, npm install
, and run npm test