Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. <cfscript>
  2. salesPeople = getSalesPeople();
  3.  
  4. theStars = salesPeople.map((row)=>{
  5. var newRow = duplicate(row);
  6. newRow["star"] = row.sales >= 10000
  7. ? "*"
  8. : "";
  9. return newRow;
  10. });
  11.  
  12. writeDump( theStars );
  13.  
  14.  
  15.  
  16. function getSalesPeople(){
  17. return [
  18. {
  19. id: 1,
  20. firstName: "Susan",
  21. lastName: "Lane",
  22. email: "slane@gmail.com",
  23. sales: 26540.43
  24. },
  25. {
  26. id: 2,
  27. firstName: "John",
  28. lastName: "Doe",
  29. email: "johndoe@example.com",
  30. sales: 54120.64
  31. },
  32. {
  33. id: 3,
  34. firstName: "Mary",
  35. lastName: "Smith",
  36. email: "marysmith@example.com",
  37. sales: 1540.78
  38. }
  39. ];
  40. }
  41. </cfscript>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement