Advertisement
xapu

Untitled

Mar 25th, 2018
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. let iCreateHumanProps = (name = '', age = '', gender = '') => {
  2. return {
  3. name,
  4. age,
  5. race: 'human',
  6. gender
  7. }
  8. }
  9.  
  10. let human = humanProps => {
  11. let person = humanProps
  12.  
  13. let mate = anotherPerson => {
  14. if (person.gender === anotherPerson.gender) {
  15. console.log('gay human')
  16. }
  17.  
  18. if (person.gender !== human.gender) {
  19. console.log('vsichko e to4no')
  20. }
  21. }
  22.  
  23. return {
  24. humanProps,
  25. mate
  26. }
  27. }
  28.  
  29. let pesho = human(iCreateHumanProps('pesho', 20, 'male'))
  30. let maria = human(iCreateHumanProps('Maria', 23, 'female'))
  31.  
  32. maria.mate(pesho)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement