letdata={};letid=Math.random();// Create if not exists (primary key as object key)!data[id]&&(data[id]={"nama":"Taufik","asal":"?"});// Readconsole.log(data[id]||{"nama":null,"asal":null});// Updatedata[id]&&Object.assign(data[id],{"nama":"Nur"});// Deletedeletedata[id];
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Discussion on: CRUD in JSON
For further actions, you may consider blocking this person and/or reporting abuse