generateIdGenerator() {
    var counter = 0;
    function idGenerator(doc) {
      var id;
      do {
        id = 'snap-it' + counter++;
      } while (doc.getElementById(id));
      return id;
    }
    return idGenerator;
  }
/**
   * Create a function that will generate strings which can be used as
   * ids.
   *
   * @return {Function<Document>} A funtion that generates a valid id each time
   *     it is called.
   */
Create a function that will generate strings which can be used as
ids.

@return {Function} A funtion that generates a valid id each time
it is called.
Create a function that will generate strings which can be used as ids . @return { Function } A funtion that generates a valid id each time it is called .
generateIdGenerator() {
    var counter = 0;
    function idGenerator(doc) {
      var id;
      do {
        id = 'snap-it' + counter++;
      } while (doc.getElementById(id));
      return id;
    }
    return idGenerator;
  }
generateIdGenerator ( ) { var counter = 0 ; function idGenerator ( doc ) { var id ; do { id = 'snap-it' + counter ++ ; } while ( doc . getElementById ( id ) ) ; return id ; } return idGenerator ; }
Create a function that will generate strings which can be used as
 ids.
Create a function that will generate strings which can be used as ids .