SHARE
TWEET

Untitled

a guest Oct 16th, 2019 114 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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([
  13.         theStars,
  14.         salesPeople
  15.     ]);
  16.    
  17.    
  18.    
  19.     function getSalesPeople(){
  20.         return [
  21.             {
  22.                 id: 1,
  23.                 firstName: "Susan",
  24.                 lastName: "Lane",
  25.                 email: "slane@gmail.com",
  26.                 sales: 26540.43
  27.             },
  28.             {
  29.                 id: 2,
  30.                 firstName: "John",
  31.                 lastName: "Doe",
  32.                 email: "johndoe@example.com",
  33.                 sales: 54120.64
  34.             },
  35.             {
  36.                 id: 3,
  37.                 firstName: "Mary",
  38.                 lastName: "Smith",
  39.                 email: "marysmith@example.com",
  40.                 sales: 1540.78
  41.             }
  42.         ];
  43.     }
  44. </cfscript>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top