Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
// Bonfire: Diff Two Arrays | |
// Author: @fcc0208647c | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-diff-two-arrays | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function diff(arr1, arr2) { | |
arr3 = arr1.concat(arr2); | |
final = arr3.filter(function(val, index, arr){ | |
console.log(arr3.indexOf(val),arr3.lastIndexOf(val),val); |
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
// Bonfire: Sum All Numbers in a Range | |
// Author: @fcc0208647c | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-sum-all-numbers-in-a-range | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function sumAll(arr) { | |
arr.sort(); | |
start = Math.min.apply(Math, arr); | |
end = Math.max.apply(Math, arr); |
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
// Bonfire: Where do I belong | |
// Author: @fcc0208647c | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-where-do-i-belong# | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function where(arr, num) { | |
myarr = arr.sort(function(a,b) {return a - b;}); | |
console.log(myarr); | |
minval = Math.min.apply(Math, myarr); | |
maxval = Math.max.apply(Math, myarr); |
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
// Bonfire: Seek and Destroy | |
// Author: @fcc0208647c | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-seek-and-destroy# | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function destroyer(arr) { | |
var slicedArgs = Array.prototype.slice.call(arguments, 1); | |
console.log(slicedArgs + " are my args"); | |
mylist = arguments[0]; |
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
// Bonfire: Falsy Bouncer | |
// Author: @fcc0208647c | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-falsy-bouncer# | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function bouncer(arr) { | |
trues = arr.filter(Boolean); | |
return trues; |
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
// Bonfire: Mutations | |
// Author: @fcc0208647c | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-mutations# | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function mutation(arr) { | |
firstElement = arr[0].toLowerCase().split(''); | |
secondElement = arr[1].toLowerCase().split(''); | |
for (var i=0; i<secondElement.length; 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
// Bonfire: Slasher Flick | |
// Author: @fcc0208647c | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-slasher-flick# | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function slasher(arr, howMany) { | |
return arr.slice(howMany, arr.length); | |
} |
NewerOlder