Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <cfscript>
- salesPeople = getSalesPeople();
- theStars = salesPeople.map((row)=>{
- var newRow = duplicate(row);
- newRow["star"] = row.sales >= 10000
- ? "*"
- : "";
- return newRow;
- });
- writeDump({
- " stars": theStars,
- "original": salesPeople
- });
- function getSalesPeople(){
- return [
- {
- id: 1,
- firstName: "Susan",
- lastName: "Lane",
- email: "slane@gmail.com",
- sales: 26540.43
- },
- {
- id: 2,
- firstName: "John",
- lastName: "Doe",
- email: "johndoe@example.com",
- sales: 54120.64
- },
- {
- id: 3,
- firstName: "Mary",
- lastName: "Smith",
- email: "marysmith@example.com",
- sales: 1540.78
- }
- ];
- }
- </cfscript>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement