I've just lost my PostgreSQL virginity as a result of the new website I'm building. (The site is built using NodeJS, and the Express framework.) Following a tutorial, I've put the following line into one of the site's source code files:
const { Client } = require("pg");
I was just wondering what the purpose of the braces around Client
was. They obviously do serve a purpose; removing them gives a "Client is not a constructor" error when I try to call new Client(...)
later on. But what is it?