function getHeadlinesArray() {
  // Fetches headlines for a given topic
  let hdlnsResp = [];
  let encodedtopic = encodeURIComponent(topic);
  ss.toast("Getting headlines for: " + topic);
  let response = UrlFetchApp.fetch(apiEndPointHdr + encodedtopic + '&apiKey=' +
    newsApiKey);
  let results = JSON.parse(response);
  let articles = results["articles"];

  for (let i = 0; i < articles.length && i < articleMax; i++) {
    let newsStory = articles[i]['title'];
    if (articles[i]['description'] !== null) {
      newsStory += ': ' + articles[i]['description'];
    }
    // Scrubs newsStory of invalid characters
    newsStory = scrub(newsStory);

    // Constructs hdlnsResp as a 2d array. This simplifies syncing to the sheet.
    hdlnsResp.push(new Array(newsStory));
  }

  return hdlnsResp;
}
Fetches current headlines from the Free News API