The usefull Code that help you to write big code, there is it:
1. Remove property from the Object
let’s say we have object like this
1 2 3 4 5 |
var qi = { _inserted_by : 'qiearman', name : 'Qi', email: 'qi@email.com' }; |
then, we want to save this data to db, but we don’t need “_inserted_by” property there. To do that we can do something like bellow.
1 2 3 4 5 6 |
// use delete to property name directly delete qi._inserted_by; // or you can treat property as array index delete qi['_inserted_by']; |
that simple, but helpfull.