This plugin transforms undefined into void 0 which returns undefined regardless of if it's been reassigned
GitHub · npm · Edit this page
This plugin transforms undefined
into void 0
which returns undefined regardless of if it’s been reassigned.
In
foo === undefined;
Out
foo === void 0;
npm install babel-plugin-transform-undefined-to-void
.babelrc
(Recommended).babelrc
{
"plugins": ["transform-undefined-to-void"]
}
babel --plugins transform-undefined-to-void script.js
require("babel-core").transform("code", {
plugins: ["transform-undefined-to-void"]
});