SHARE
TWEET

Untitled

a guest Oct 16th, 2019 81 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( 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>
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