{"size": 771, "ext": "js", "max_stars_repo_path": "scripts/handlers/last-result-reset.js", "max_stars_repo_name": "katerynakim/prompt-alert-calculate_week2", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "scripts/handlers/last-result-reset.js", "max_issues_repo_name": "katerynakim/prompt-alert-calculate_week2", "max_issues_repo_issues_event_min_datetime": "2020-06-25T13:05:44.000Z", "max_issues_repo_issues_event_max_datetime": "2020-06-27T09:16:29.000Z", "max_forks_repo_path": "scripts/handlers/last-result-reset.js", "max_forks_repo_name": "katerynakim/prompt-alert-calculate_week2", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 23.3636363636, "max_line_length": 75, "alphanum_fraction": 0.6433203632}
'use strict';

console.log('--- loading: reset lastResult');

function resetLastResultHandler() {
  debugger;
  console.log('\n--- action: reset lastResult ---');
  console.log('lastResult (before):', typeof lastResult, '\n', lastResult);
  
  let newNumber = NaN;
  while (Number.isNaN(newNumber)) {
    const userInput = prompt('please enter last result');
    console.log('userInput:', typeof userInput, '\n', userInput);
    if (userInput === null) {
      alert('ok, bye.');
      return;
    }

    newNumber = Number(userInput);
    console.log('newNumber:', typeof newNumber, '\n', newNumber);
  }

  alert('thank you');

  lastResult = newNumber;
  
  

  console.log('lastResult (after):', typeof lastResult, '\n', lastResult);

  displayLastResultHandler();
}
