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
// ej1 | |
const list = [1,2,3,4,5,6,7] | |
const result = list | |
.forEach(a => a % 2 === 0 ? a : -a) | |
.filter(b => b > 2) | |
.some(c => c < 10) | |
console.log('ej1', result) // throws an error, because of `forEach` | |
// ej2 | |
const key = Symbol("${window}") |
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
{ | |
"1542302281977808155_3448238252": [ | |
{ | |
"from": { | |
"full_name": "rosaparksragdoll" | |
}, | |
"text": "Hello Lovely 🐈🐾" | |
} | |
], | |
"1541532966311636230_3448238252": [ |
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
const expect = require('expect') | |
const { curry, split, map, filter, reduce } = require('ramda') | |
// Exercise 1 | |
//============== | |
// Refactor to remove all arguments by partially applying the function. | |
const words = split(' ') | |
expect(words('Jingle bells Batman smells')).toEqual([ |
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
/* | |
* Implement the following classic FP functions using | |
* _only_ Array.prototype.{reduce|reduceRight}(). 🤓 | |
*/ | |
const filter = f => xs => xs | |
const map = f => xs => xs | |
const every = f => xs => xs |
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
const accounting = require('accounting') | |
const expect = require('expect') | |
const { | |
add, | |
compose, | |
concat, | |
filter, | |
flip, | |
head, | |
join, |
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
// Ultimate version | |
const curry = (f, ...args) => | |
f.length <= args.length | |
? f(...args) | |
: x => curry(f, ...args, x) |
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
require('./support') | |
const expect = require('expect') | |
const Task = require('data.task') | |
const { | |
add, | |
curry, | |
compose, | |
concat, | |
prop, | |
map, |
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
require('./support') | |
const path = require('path') | |
const expect = require('expect') | |
const Task = require('data.task') | |
const { | |
chain, | |
curry, | |
compose, | |
identity, | |
prop, |
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
require('./support') | |
const expect = require('expect') | |
const Task = require('data.task') | |
const { add, curry, reduce } = require('ramda') | |
// TEST HELPERS | |
// ===================== | |
const getPost = i => | |
new Task((rej, res) => |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.