0

In the Node JS Child Process documentation, the following line is given in an example:

const { spawn } = require('child_process');

Why is destructuring assignment used here? and what exactly is it doing? Is this implying that require('child_process') returns an object with multiple elements, and 'spawn' is the first? (I thought objects' elements were not in any guaranteed order?)

Ryan Griggs
  • 2,457
  • 2
  • 35
  • 58

0 Answers0