Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <cfscript>
  2. arr = [1,2,3,4];
  3. struct = {"a":1,"b":2};
  4.  
  5. /* FAILS WITH PARAMETER VALIDATION ERROR */
  6. //results = arr.map((a)=>a+1);
  7. //results = struct.map((a,b,c)=>a);
  8. //results = arr.filter((a)=>a==2);
  9. //results = struct.filter((a,b)=>b==2);
  10.  
  11.  
  12. results = arr.map((a)=>{return a+1});
  13. results = arr.filter((a)=>{return a==2});
  14.  
  15. results = struct.map((a,b,c)=>{return a});
  16. results = struct.filter((a,b)=>{return b==2});
  17.  
  18. // For some reason, reduce functions parse parameters correctly
  19. results = arr.reduce((a,b)=>a);
  20. results = struct.reduce((a,b,c)=>a);
  21.  
  22. writeDump('worked!');
  23.  
  24.  
  25. </cfscript>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement