Last active
August 23, 2019 01:15
-
-
Save PartyLich/76c082009325ca9db9041f60ff0c7799 to your computer and use it in GitHub Desktop.
So far away from me
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
(function farAway() { | |
const me = { | |
about: 'Famous musician, looks like Buddy Holly', | |
birthday: new Date('June 13, 1970'), | |
hobbies: ['knitting'], | |
favoriteFood: 'burnt lamb', | |
} | |
let you = { | |
are: function (attr) {return Object.assign({},this, attr)} | |
know: function (subject) { this.knows.push(subject); } | |
knows: [], | |
want = function (method) { | |
return (subject) => this[method](subject) | |
}, | |
}; | |
you = you.are({ | |
age: 18, | |
sex: 'gril', | |
location: 'small city', | |
country: 'Japan', | |
}); | |
you.heardMe = { | |
medium:'on the radio', | |
when: new Date((new Date()).getFullYear() - 1, | |
new Date().getMonth()), | |
}; | |
you.want('know')(me.about); | |
you.want('know')(me.hobbies); | |
you.want('know')(me.favoriteFood); | |
you.want('know')(me.birthday); | |
console.info(you); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment