function createNodes(expectedParent, nodes, callback) {
  function createNext() {
    if (nodes.length) {
      var node = nodes.shift();
      chrome.bookmarks.create(node, function(results) {
        node.id = results.id;
        node.index = results.index;
        expectedParent.children.push(node);

        // Create each node a minimum of 1ms apart.  This ensures that each
        // node will have a unique timestamp.
        setTimeout(createNext, 1);
      });
    } else {
      callback();
    }
  }
  createNext();
}
// the nodes have been successfully created.
the nodes have been successfully created.
the nodes have been successfully created .
function createNodes(expectedParent, nodes, callback) {
  function createNext() {
    if (nodes.length) {
      var node = nodes.shift();
      chrome.bookmarks.create(node, function(results) {
        node.id = results.id;
        node.index = results.index;
        expectedParent.children.push(node);
        setTimeout(createNext, 1);
      });
    } else {
      callback();
    }
  }
  createNext();
}
function createNodes ( expectedParent , nodes , callback ) { function createNext ( ) { if ( nodes . length ) { var node = nodes . shift ( ) ; chrome . bookmarks . create ( node , function ( results ) { node . id = results . id ; node . index = results . index ; expectedParent . children . push ( node ) ; setTimeout ( createNext , 1 ) ; } ) ; } else { callback ( ) ; } } createNext ( ) ; }
the nodes have been successfully created.
the nodes have been successfully created .
// Create each node a minimum of 1ms apart.  This ensures that each // node will have a unique timestamp.