{"size": 357, "ext": "js", "max_stars_repo_path": "getPluralNoun.js", "max_stars_repo_name": "Defite/helpers", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "getPluralNoun.js", "max_issues_repo_name": "Defite/helpers", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "getPluralNoun.js", "max_forks_repo_name": "Defite/helpers", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 18.7894736842, "max_line_length": 43, "alphanum_fraction": 0.5826330532}
const getPluralNoun = (count, nounArr) => {
  let absCount = Math.abs(count);
  absCount %= 100;

  if (absCount >= 5 && absCount <= 20) {
    return nounArr[2];
  }
  absCount %= 10;
  if (absCount === 1) {
    return nounArr[0];
  }
  if (absCount >= 2 && absCount <= 4) {
    return nounArr[1];
  }
  return nounArr[2];
};

export default getPluralNoun;
