0

I'm reading someone's nodejs source and it has:

import request from 'reqwest';
import {minify} from 'html-minifier';

Why there is a {} pair on the minify? What does this {} do?

AGamePlayer
  • 7,404
  • 19
  • 62
  • 119
  • 5
    Possible duplicate of [Javascript object bracket notation ({ Navigation } =) on left side of assign](https://stackoverflow.com/questions/26999820/javascript-object-bracket-notation-navigation-on-left-side-of-assign) – VLAZ Oct 12 '19 at 12:36
  • @VLAZ this question is not a duplicate of the one you posted. This question talks about ES6 modules while your flagged question talks about destructuring – Ayush Gupta Oct 12 '19 at 12:56
  • @AyushGupta indeed, I realised this right after linking the dupe. Somebody posted a link to a question that speifically talked about imports right after but I couldn't vote for that as a dupe. And now the comment is gone... – VLAZ Oct 12 '19 at 12:57
  • 1
    Found it, this is the other question that was linked [When should I use curly braces for ES6 import?](https://stackoverflow.com/questions/36795819/when-should-i-use-curly-braces-for-es6-import) – VLAZ Oct 12 '19 at 13:00

1 Answers1

0

Curly braces { } are special syntax in JSX which are used to evaluate a JavaScript expression( A JavaScript expression can be a variable, function, object, etc..)

  • This is not correct. [VLAZ](https://stackoverflow.com/questions/58354222/what-is-the-meaning-of-in-this-node-js-code/75722303#comment103062259_58354222) has pointed at a very well-accepted answer [here](https://stackoverflow.com/a/36796281/6951294). – sloppypasta Mar 18 '23 at 14:48