{"size": 704, "ext": "js", "max_stars_repo_path": "logging/exercises/repeat-or-remove-3.js", "max_stars_repo_name": "ThibaultLesuisse/welcome-to-js", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "logging/exercises/repeat-or-remove-3.js", "max_issues_repo_name": "ThibaultLesuisse/welcome-to-js", "max_issues_repo_issues_event_min_datetime": "2021-03-15T19:05:51.000Z", "max_issues_repo_issues_event_max_datetime": "2021-04-02T21:01:08.000Z", "max_forks_repo_path": "logging/exercises/repeat-or-remove-3.js", "max_forks_repo_name": "ThibaultLesuisse/welcome-to-js", "max_forks_repo_forks_event_min_datetime": "2021-02-13T20:11:35.000Z", "max_forks_repo_forks_event_max_datetime": "2021-03-02T20:39:45.000Z"}
{"max_stars_count": null, "max_issues_count": 7, "max_forks_count": 2, "avg_line_length": 25.1428571429, "max_line_length": 65, "alphanum_fraction": 0.6448863636}
let phrase = null;
while (phrase === null) {
  phrase = prompt('enter a phrase');
}

let keepLetters = confirm(
  '"ok" to remove everything that is not a letter\n' +
    '"cancel" to repeat each character'
);

let newPhrase = '';
if (keepLetters) {
  let smallLetters = 'abcdefghijklmnopqrstuvwxyz';
  for (let i = 0; i < phrase.length; i = i + 1) {
    let smallLetter = phrase[i].toLowerCase();
    if (smallLetters.includes(smallLetter)) {
      newPhrase = phrase + smallLetter;
    }
  }
} else if (!keepLetters) {
  for (let index = 0; index < phrase.length; index = index + 1) {
    let smallLetter = phrase[index];
    newPhrase = newPhrase + smallLetter + smallLetter;
  }
}

alert(newPhrase);
