0

In this code snippet:

const {set} = require("lodash");

What does the {} do ?

panagdu
  • 2,055
  • 1
  • 21
  • 35
  • It will import specific object/function from the module and initialize it with the same name – Rajesh Jun 06 '17 at 10:50

1 Answers1

1

It's destructuring assignment.

It's equivalent to

const set = require('lodash').set
Andy_D
  • 3,676
  • 22
  • 18