Skip to content

Instantly share code, notes, and snippets.

@micheleriva
Last active March 22, 2018 22:12
Show Gist options
  • Save micheleriva/ea27f63f38bacddb574368f287b1ab04 to your computer and use it in GitHub Desktop.
Save micheleriva/ea27f63f38bacddb574368f287b1ab04 to your computer and use it in GitHub Desktop.
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