3 ms·
if (!posts.hasOwnProperty(req.body.slug)) { posts[req.body.slug] = new Post(req.body); res.send(200); } Maybe I'm missing something, but doesn'
by cousin_it 14y ago
if (!posts.hasOwnProperty(req.body.slug)) {
posts[req.body.slug] = new Post(req.body);
res.send(200);
}
Maybe I'm missing something, but doesn't that code also happily assign to properties like "constructor", not just "hasOwnProperty"?
- deleted 14y ago[deleted]