Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let iCreateHumanProps = (name = '', age = '', gender = '') => {
- return {
- name,
- age,
- race: 'human',
- gender
- }
- }
- let human = humanProps => {
- let person = humanProps
- let mate = anotherPerson => {
- if (person.gender === anotherPerson.gender) {
- console.log('gay human')
- }
- if (person.gender !== human.gender) {
- console.log('vsichko e to4no')
- }
- }
- return {
- humanProps,
- mate
- }
- }
- let pesho = human(iCreateHumanProps('pesho', 20, 'male'))
- let maria = human(iCreateHumanProps('Maria', 23, 'female'))
- maria.mate(pesho)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement