My app crashes every time it reaches this line:
const {name, price} = req.query;
^
can\'t seem to locate the exact answer..here is the
According to node.green, the object destructuring with primitives syntax works after Node.JS v6.4.0, and throws the Unexpected Token {
on Node.js versions below that.
Also, the object rest/spread properties only works out of the box from Node v8.6.0. It works in v8.2.1 with the --harmony
flag, and throws the Unexpected Token ...
on Node.js versions below that.
You tried to use destructuring assignment
. AFAIK its support by nodejs v.6+ from a box and from 4.2.2 with flag --harmony_destructuring