function loadComments(path) {
  fetch(path)
      .then(response => response.json())
      .then(
          json => {
            for (index in json) {
              let currentComment = json[index];
              let userName = currentComment['userName'];
              let commentBody = currentComment['commentBody'];
              let blobKey = undefined;
              // we need to check whether a blobKey exists
              console.log(json);
              if (currentComment.hasOwnProperty('blobKey')) {
                blobKey = currentComment['blobKey'];
              }
              addComment(
                  /* name= */ userName, /* content= */ commentBody,
                  /* blobKey= */ blobKey);
            }
          }
      );
}
/**
 * Fetches the comment data and adds each of them to the loaded
 * content.
 * TODO(morleyd): change individual comment load to be asynchronous to improve
 * performance. It might also make sense to have a hard limit on the number of
 * comments loaded, think about this for future implementations.
 * @param {string} path The path to use when fetching data
 */
Fetches the comment data and adds each of them to the loaded
content.
TODO(morleyd): change individual comment load to be asynchronous to improve
performance. It might also make sense to have a hard limit on the number of
comments loaded, think about this for future implementations.
@param {string} path The path to use when fetching data
Fetches the comment data and adds each of them to the loaded content . TODO ( morleyd ) : change individual comment load to be asynchronous to improve performance . It might also make sense to have a hard limit on the number of comments loaded think about this for future implementations . @param { string } path The path to use when fetching data
function loadComments(path) {
  fetch(path)
      .then(response => response.json())
      .then(
          json => {
            for (index in json) {
              let currentComment = json[index];
              let userName = currentComment['userName'];
              let commentBody = currentComment['commentBody'];
              let blobKey = undefined;
              console.log(json);
              if (currentComment.hasOwnProperty('blobKey')) {
                blobKey = currentComment['blobKey'];
              }
              addComment(
                   userName,  commentBody,
                   blobKey);
            }
          }
      );
}
function loadComments ( path ) { fetch ( path ) . then ( response => response . json ( ) ) . then ( json => { for ( index in json ) { let currentComment = json [ index ] ; let userName = currentComment [ 'userName' ] ; let commentBody = currentComment [ 'commentBody' ] ; let blobKey = undefined ; console . log ( json ) ; if ( currentComment . hasOwnProperty ( 'blobKey' ) ) { blobKey = currentComment [ 'blobKey' ] ; } addComment ( userName , commentBody , blobKey ) ; } } ) ; }
Fetches the comment data and adds each of them to the loaded
 content.
Fetches the comment data and adds each of them to the loaded content .
// we need to check whether a blobKey exists /* name= */ /* content= */ /* blobKey= */