{"size": 376, "ext": "js", "max_stars_repo_path": "src/reverseString.js", "max_stars_repo_name": "leonmaks/module11_homework", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/reverseString.js", "max_issues_repo_name": "leonmaks/module11_homework", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/reverseString.js", "max_forks_repo_name": "leonmaks/module11_homework", "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": 25.0666666667, "max_line_length": 66, "alphanum_fraction": 0.6409574468}
const isString = l => typeof l === 'string' || l instanceof String

const reverseString = l => {
  if (!isString(l)) return undefined
  const reversed = []
  for (let i = l.length - 1; i >= 0; i--)  reversed.push(l[i])
  return reversed.join('').toString()
}

module.exports = reverseString

if (require.main === module) {
  console.log('result=', reverseString('example'))
}
