Guest User

Untitled

a guest
Apr 26th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. var numbers = [1, 4, 9];
  2. var doubles = numbers.map(function(num) {
  3. return num * 2;
  4. });
  5.  
  6. // Logs [2, 8, 18]
  7. console.log(doubles);
  8.  
  9. var data = [
  10. {
  11. name: 'Kyle',
  12. occupation: 'Fashion Designer'
  13. },
  14. {
  15. name: 'Liza',
  16. occupation: 'Web Developer'
  17. },
  18. {
  19. name: 'Emily',
  20. occupation: 'Web Designer'
  21. },
  22. {
  23. name: 'Melissa',
  24. occupation: 'Fashion Designer'
  25. },
  26. {
  27. name: 'Tom',
  28. occupation: 'Web Developer'
  29. }
  30. ];
  31. var names = data.map(function (item) {
  32. return item.name;
  33. });
Add Comment
Please, Sign In to add comment