This file contains hidden or 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 list = ['a', 'b', 'c','d']; | |
var removeFromArray = (list,index) => { | |
var before = list.slice(0, index); | |
var after = list.slice(index + 1, list.length); | |
var result = before.concat(after); | |
return result; | |
}; | |
This file contains hidden or 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 compose = (func1,func2) => { | |
return (arg) =>{ | |
return func1(func2(arg)); | |
}; | |
}; | |
var upCase = (str) => str.toUpperCase(); | |
var exclaim = (str) => `${str}!!!`; |
This file contains hidden or 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 R = require('ramda'); | |
var list = [1,2,3,4,5]; | |
var filter = R.curry(function(func,array){ | |
return array.filter(func); | |
}) | |
var oddsOnly = function(num){ |
This file contains hidden or 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 p = new Promise(function(resolve, reject) { | |
if(1 === 1) { // set 1===2 to make it fail | |
resolve('Success!'); | |
} | |
else { | |
reject('Failure!'); | |
} | |
}); |
This file contains hidden or 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 fetch = require('node-fetch'); | |
// fetch('https://api.github.com/users/jmsevold') | |
// .then(function(res) { | |
// return res.json(); | |
// }).then(function(result) { | |
// url = result.followers_url | |
// }).catch(function (error) { | |
// console.log(error); | |
// }); |
NewerOlder