{"size": 636, "ext": "js", "max_stars_repo_path": "7kyu/No Oddities Here.js", "max_stars_repo_name": "Giacomo001/CodeWars-", "max_stars_repo_stars_event_min_datetime": "2019-02-09T16:48:06.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-28T15:35:36.000Z", "max_issues_repo_path": "7kyu/No Oddities Here.js", "max_issues_repo_name": "Giacomo001/CodeWars-Js", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "7kyu/No Oddities Here.js", "max_forks_repo_name": "Giacomo001/CodeWars-Js", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.9310344828, "max_line_length": 93, "alphanum_fraction": 0.6761006289}
/* Write a small function that returns the values of an array that are not odd.

All values in the array will be integers. Return the good values in the order they are given.

function noOdds(values)
*/

//Long solution with a for loop
function noOdds(values) {
  var even = []
  for(value in values) {
    if(value % 2 === 0){
      even.push(values[value])
    }
  }
  return even
}

//Short solution with '.filter' method
const noOdds = values => values.filter(num => num % 2 === 0)

//Solution with nested functions
function noOdds(values){
  function isEven(number){
    return !(number % 2)
  }  
  return values.filter(isEven)
}
