When I study Electron, I found two ways of getting a BrowserWindow object.
const {BrowserWindow} = require('electron')
and
const electron = require('electron')
const BrowserWindow = electron.BrowserWindow
What is the difference between const
and const {}
in JavaScript?
I can't understand why the const {}
can work. Do I miss anything important about JavaScript?