I have a json file, employees.json, that I would like to append data to this object. The file looks like this:
var txt = '{"employees":[' +
'{"firstName":"Jerry","lastName":"Negrell","time":"9:15 am","email":"[email protected]","phone":"800-597-9405","image":"images/jerry.jpg" },' +
'{"firstName":"Ed","lastName":"Snide","time":"9:00 am","email":"[email protected]","phone":"800-597-9406","image":"images/ed.jpg" },' +
'{"firstName":"Pattabhi","lastName":"Nunn","time":"10:15 am","email":"[email protected]","phone":"800-597-9407","image":"images/pattabhi.jpg" }'+
']}';
I would like to append:
- firstName:Mike
- lastName:Rut
- time:10:00 am
- email:[email protected]
- phone:800-888-8888
- image:images/mike.jpg
to employee.json.
How would I accomplish this?