Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. //Задачка №3
  2. function parent1() {
  3. var multiplier = 3;
  4. return [33, 77, 99, 81, 55].map(
  5. function(I) {
  6. return I * multiplier
  7. }
  8. );
  9. }
  10.  
  11. function parent2() {
  12. this.multiplier = 3;
  13.  
  14. function multiplierFun(I) {
  15. return I * this.multiplier
  16. }
  17.  
  18. return [33, 77, 99, 81, 55].map(multiplierFun);
  19. }
  20.  
  21. console.log(parent1());
  22. console.log(parent2());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement