Skip to content Skip to sidebar Skip to footer

Destructuring Assignment Within Import Statements

According to this source and a vague memory of having seen this sort of usage in a project somewhere, I'm curious if anyone has been able to do the following: import {map: { series

Solution 1:

You can use destructuring assignment only when you're assigning variables. Imports are completely different thing and you can't use destructuring assignment with them.

You can instead use destructuring assignment with a direct require() call (assuming that you're using Node.js or RequireJS):

const {map: { series }} = require('contra')

Post a Comment for "Destructuring Assignment Within Import Statements"