{"size": 663, "ext": "js", "max_stars_repo_path": "reverse-the-odd-length-words/answer.js", "max_stars_repo_name": "redbearin/skill-work", "max_stars_repo_stars_event_min_datetime": "2020-01-15T02:13:13.000Z", "max_stars_repo_stars_event_max_datetime": "2020-01-15T02:13:13.000Z", "max_issues_repo_path": "reverse-the-odd-length-words/answer.js", "max_issues_repo_name": "redbearin/skill-work", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "reverse-the-odd-length-words/answer.js", "max_forks_repo_name": "redbearin/skill-work", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 34.8947368421, "max_line_length": 72, "alphanum_fraction": 0.6636500754}
const reverseOdd = (str) => {
  const wordArray = str.split(' ');
  const finalWordArray = [];
  for (let index = 0; index < wordArray.length; index++) {
    // is it odd?
    wordArray[index].length % 2 !== 0 ?
    // if yes, then make array of letters, reverse letters,
    // join back into string and add to finalWordArray
    finalWordArray.push(wordArray[index].split('').reverse().join('')) :
    // if not, add word, without changes, to finalWordArray 
    finalWordArray.push(wordArray[index]);
  }
  // convert finalWordArray to string
  return finalWordArray.join(' ');
}

const str = "Make sure uoy only esrever sdrow of ddo length";

reverseOdd(str);