Skip to content

Instantly share code, notes, and snippets.

View mxwendt's full-sized avatar

Maximilian Wendt mxwendt

View GitHub Profile
@mxwendt
mxwendt / fibonacci.js
Last active August 11, 2016 10:12
A JavaScript function that returns the first n numbers of the Fibonacci sequence.
/**
* @param {Number} size is the amount of numbers of the Fibonacci sequence
*/
function fibonacci(size) {
var first = 0;
var second = 1;
var next;
var count = 2;
var result = [first, second];
if (size < 2) {