I'm trying to create a simple model in nodejs but got the following error
var model = {
^
SyntaxError: Invalid or unexpected token
at createScript (vm.js:80:10)
Model
function getAllSales(limit) {
const sales = [];
var model = {
"id": "1",
"products": [{
"id": "1",
"value": "10"
}, {
"id": "2",
"value": "20"
}],
"total": "30.00",
"date": "2017-10-02"
};
sales.push(model);
return sales.slice(0, limit);
}