I have used variable declaration in JavaScript only as - const name = require("something");
- But what does curly braces means in
const { name } = require('something')
. ? - And why some declaration have parentheses () in its end like-
const name = require('something')();
?
What are the significance of both and where to use them while declaring variables? Thanks in advance!