function get( num){ var a = num //var a = new Array(3); for (var i = 0; i <= 50; i++) { //a.push(i); if (a <= 40) { return "Yes its less than 40" ; } else { return "No its more than 40" ; } } } console.log(get(41));