code: function cleanup() {
  
    var ds = application.dataStore;
  
    //delete the application's directory.  This will auto-delete any contained accounts and groups:
    ds.getResource(application.defaultAccountStoreMapping.href, function(err, mapping) {
      if (err) throw err;
  
      console.log('Retrieved application accountStoreMapping for deletion:');
      console.log(mapping);
  
      ds.deleteResource(mapping.accountStore, function(err) {
        if(err) throw err;
  
        console.log('Deleted application directory.');
  
        application.delete(function(err) {
          if (err) throw err;
          console.log('Deleted application.');
        });
      });
    });
  }
docs: ================================================== End of quickstart - cleanup quickstart data ================================================== deletes the objects we created during the quickstart so we don't pollute the tenant