This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); |