Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  <script src="https://rawgit.com/amark/gun/0.5/gun.js"></script>
</body>
</html>
 
localStorage.clear();
var gun = Gun();
var list = gun.get('list');
var item1 = gun.get('alice').put({name: "alice"});
list.set(item1);
var item2 = gun.get('bob').put({name: "bob"});
list.set(item2);
// because `set` uses the key as the index in the list...
// I can use that key to find the item in the list and null it.
// Of course, if you have dynamic IDs of items in the set,
// you would somehow have to figure the ID out first, and then do this.
list.path('bob').put(null); // de-reference
// now let's look at what the list, as a whole, looks like now...
list.val(function(data){
  console.log(data); // notice alice retains her pointer, while bob does not.
})
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers