The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from
arrays
, orproperties
fromobjects
, into distinctvariables
.(c) MDN
🐊Putout plugin adds ability to merge destructuring properties.
npm i @putout/plugin-merge-destructuring-properties
Rule merge-destructuring-properties
is enabled by default, to disable add to .putout.json
:
{
"rules": {
"merge-destructuring-properties": "off"
}
}
const {one} = require('numbers');
const {two} = require('numbers');
const {one, two} = require('numbers');
MIT