function fetchAndChangeBody(path) {
  fetch(path).then(response => response.json()).then(json => {
    const target = document.getElementById('comment');
    let newComment = document.createElement('p');
    for (index in json) {
      newComment.innerText = json[index];
      target.appendChild(newComment);
    }
  });
}
/**
 * Fetches the value return by the given data service and then
 * modifies the content of a div to store each of the response values as a
 * paragraph.
 * @param {string} path The url of the data service to use
 */
Fetches the value return by the given data service and then
modifies the content of a div to store each of the response values as a
paragraph.
@param {string} path The url of the data service to use
Fetches the value return by the given data service and then modifies the content of a div to store each of the response values as a paragraph . @param { string } path The url of the data service to use
function fetchAndChangeBody(path) {
  fetch(path).then(response => response.json()).then(json => {
    const target = document.getElementById('comment');
    let newComment = document.createElement('p');
    for (index in json) {
      newComment.innerText = json[index];
      target.appendChild(newComment);
    }
  });
}
function fetchAndChangeBody ( path ) { fetch ( path ) . then ( response => response . json ( ) ) . then ( json => { const target = document . getElementById ( 'comment' ) ; let newComment = document . createElement ( 'p' ) ; for ( index in json ) { newComment . innerText = json [ index ] ; target . appendChild ( newComment ) ; } } ) ; }
Fetches the value return by the given data service and then
 modifies the content of a div to store each of the response values as a
 paragraph.
Fetches the value return by the given data service and then modifies the content of a div to store each of the response values as a paragraph .