Skip to content

Instantly share code, notes, and snippets.

@mindplace
Created March 29, 2016 14:38
Show Gist options
  • Select an option

  • Save mindplace/918c6e3d87a28c484da4 to your computer and use it in GitHub Desktop.

Select an option

Save mindplace/918c6e3d87a28c484da4 to your computer and use it in GitHub Desktop.
function fibonacciChecker(num) {
var series = [1, 1];
while (series[series.length - 1] < num) {
var item = series[series.length - 2] + series[series.length - 1];
series.push(item);
}
if (series[series.length - 1] === num) {
return true;
} else {
return false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment