diff options
author | elioat <elioat@tilde.institute> | 2023-07-19 23:02:43 -0400 |
---|---|---|
committer | elioat <elioat@tilde.institute> | 2023-07-19 23:02:43 -0400 |
commit | 07e6df068487ace6961901c7eb17e8b24a52912d (patch) | |
tree | 8d1d49ed903d9dfebbaacdc3b6370bcec978e803 | |
parent | aaacfd6f4d6dd57098037de179f98d846b6ad5f3 (diff) | |
download | tour-07e6df068487ace6961901c7eb17e8b24a52912d.tar.gz |
*
-rw-r--r-- | js/b.js | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/js/b.js b/js/b.js index d1d44b2..52a34af 100644 --- a/js/b.js +++ b/js/b.js @@ -22,29 +22,29 @@ const b = { }; -// pipe -const title = '10 Weird Facts About Dogs'; -const toLowerCase = (str) => str.toLowerCase(); -const addHyphens = (str) => str.replace(/\s/g, '-'); -const reverseText = (str) => (str === '') ? '' : reverseText(str.substr(1)) + str.charAt(0); -const slug = b.pipe(title, toLowerCase, addHyphens, reverseText); -console.log('pipe ', slug); - - -// compose -const toUpperCase = x => x.toUpperCase(); -const exclaim = x => `${x}!`; -const shout = b.compose(exclaim, toUpperCase); -const ret = shout('send in the clowns'); // "SEND IN THE CLOWNS!" -console.log('compose ', ret); - - -// curry family -const hasLetterR = b.match(/r/g); -const r1 = hasLetterR('hello world'); -const r2 = hasLetterR('just j and s and t etc'); -const r3 = b.filter(hasLetterR, ['rock and roll', 'smooth jazz']); -const noVowels = b.replace(/[aeiou]/ig); -const censored = noVowels('*'); -const r4 = censored('Chocolate Rain'); -console.log('curry ', r1, r2, r3, r4); \ No newline at end of file +// // pipe +// const title = '10 Weird Facts About Dogs'; +// const toLowerCase = (str) => str.toLowerCase(); +// const addHyphens = (str) => str.replace(/\s/g, '-'); +// const reverseText = (str) => (str === '') ? '' : reverseText(str.substr(1)) + str.charAt(0); +// const slug = b.pipe(title, toLowerCase, addHyphens, reverseText); +// console.log('pipe ', slug); + + +// // compose +// const toUpperCase = x => x.toUpperCase(); +// const exclaim = x => `${x}!`; +// const shout = b.compose(exclaim, toUpperCase); +// const ret = shout('send in the clowns'); // "SEND IN THE CLOWNS!" +// console.log('compose ', ret); + + +// // curry family +// const hasLetterR = b.match(/r/g); +// const r1 = hasLetterR('hello world'); +// const r2 = hasLetterR('just j and s and t etc'); +// const r3 = b.filter(hasLetterR, ['rock and roll', 'smooth jazz']); +// const noVowels = b.replace(/[aeiou]/ig); +// const censored = noVowels('*'); +// const r4 = censored('Chocolate Rain'); +// console.log('curry ', r1, r2, r3, r4); \ No newline at end of file |