Skip to content

Instantly share code, notes, and snippets.

View WonderDev21's full-sized avatar

WonderDev21 WonderDev21

View GitHub Profile
function isSubset (array1, array2) {
var temp = [];
array1 = array1.toString().split(',').map(Number);
array2 = array2.toString().split(',').map(Number);
for(i in array2) {
if(array1.indexOf(array2[i]) === -1) temp.push(array2[i]);
}
if(temp.length>0) return false;
var i;
var fib = [];
var fibNumbers=[];
fib[0] = 0;
fib[1] = 1;
for(i=2; i<=60; i++)
{
fib[i] = fib[i-2] + fib[i-1];
fibNumbers.push(fib[i])
}
function createArrayOfFunctions(x, y) {
  var arr = [];
  for(var i = 0; i<y; i++) {
   var n = (x) => x + i;
arr[i] = n(x);
  }
  return arr;
}
console.log(createArrayOfFunctions(11, 5));