bdw429s
11/10/2022, 6:42 PMvar headerReducer = (headers) => {
return headers.reduce( ( list, header)=>{
list = list.listAppend( "#header.name#: #header.value#", chr(13) & chr(10) );
return list;
}, '' );
};
2️⃣
var headerReducer = (headers) =>
headers.reduce( ( list, header) =>
list.listAppend( "#header.name#: #header.value#", chr(13) & chr(10) ), '' );
bdw429s
11/10/2022, 6:44 PM{}
when I can, but I get caught needing to do more than one thing or a silly member function that returns a non-useful value often enough that I still type the body by default many times and then refactor it down later if I can.Daniel Mejia
11/10/2022, 7:06 PMfirstheader = (headers) => headers.first()
Scott Bennett
11/10/2022, 8:37 PMScott Bennett
11/10/2022, 8:39 PMbdw429s
11/10/2022, 8:46 PMScott Bennett
11/10/2022, 8:52 PMDaniel Mejia
11/11/2022, 12:38 AMseancorfield
list.listAppend( header.name & ": " & header.value, .. )
🙂Daniel Mejia
11/11/2022, 4:47 AMDaniel Mejia
11/11/2022, 4:48 AMreturn list.listAppend( header.name & ": " & header.value, ... )
🙂bdw429s
11/12/2022, 8:17 PMlist.listAppend( "#address.emailAddress.name# <#address.emailAddress.address#>", ', ' )
and I thought that more readable than
list.listAppend( address.emailAddress.name & ' <' & address.emailAddress.address & '>', ', ' )
Once I get to a point where I'm concatenating enough strings, I'll go back to string interpolation usually.