@babel/plugin-proposal-nullish-coalescing-operator

    In

    Out

    1. var _object$foo;
    2. var foo =
    3. (_object$foo = object.foo) !== null && _object$foo !== void 0
    4. ? _object$foo
    5. : "default";
    1. npm install --save-dev @babel/plugin-proposal-nullish-coalescing-operator
      1. require("@babel/core").transformSync("code", {
      2. plugins: ["@babel/plugin-proposal-nullish-coalescing-operator"],
      3. });

      boolean, defaults to .

      When true, this transform will pretend document.all does not exist, and perform loose equality checks with null instead of strict equality checks against both null and undefined.

      Example

      In

      1. var foo = object.foo ?? "default";

      Out

      1. var _object$foo;