0

In this code snippet:

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

What does the {} do ?

panagdu
  • 2,133
  • 1
  • 21
  • 36
  • 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
  • 4,112
  • 27
  • 19