You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
var range = function(start_num, end_num)
|
|
{
|
|
if (end_num - start_num === 2)
|
|
{
|
|
return [start_num + 1];
|
|
}
|
|
else
|
|
{
|
|
var list = range(start_num, end_num - 1);
|
|
list.push(end_num - 1);
|
|
return list;
|
|
}
|
|
};
|
|
|
|
console.log(range(2,9));
|