Last active
March 22, 2018 22:12
-
-
Save micheleriva/ea27f63f38bacddb574368f287b1ab04 to your computer and use it in GitHub Desktop.
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 happy = require('./d-happy') | |
const sad = require('./d-sad') | |
const moods = [ | |
...happy, | |
...sad | |
]; | |
module.exports = moods | |
/* | |
We're using the amazing spread operator, which will let us to spread our array into another one. | |
We could also use Array.push() or Array.concat(), but the spread operator is just beautiful :) | |
Btw, that's what we got: | |
[ { input: 'I am happy', output: { happy: 1 } }, | |
{ input: 'I feel fine', output: { happy: 1 } }, | |
{ input: 'What a good day!', output: { happy: 1 } }, | |
{ input: 'I am sad', output: { sad: 1 } }, | |
{ input: 'I feel bad', output: { sad: 1 } }, | |
{ input: 'Such a bad day', output: { sad: 1 } } | |
] | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment