Node.js, Express.js - unexpected token {

后端 未结 2 1187
不知归路
不知归路 2021-01-28 11:35

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

2条回答
  •  一向
    一向 (楼主)
    2021-01-28 12:18

    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

提交回复
热议问题