I have an API endpoint in my Node JS express app as below:
app.get('/src/static', (req, res) => {
res.send({ hello: [1, undefined, 2, 3] });
});
Which is returning the response as below when I call that endpoint:
{"hello":[1,null,2,3]}
In the response above, It should return the undefined
in the array. but, It is returning the null
.
Additional details:
Node JS: 14
"express": "^4.17.1"
What could be the problem?