Tips for golfing javascript code, especially converting while loop to expression The code:

function L(){N=null;E=[N,N];t=this;h=E;t.u=i=&gt;h=[i,h];
t.o=_=&gt;h==E?N:h[+!(h=h[1])];t.e=(i,l)=&gt;h=(l||h)==E?[i, 
E]:[(l||h)[0],t.e(i,(l||h)[1])];t.s=_=&gt;{o="";while(i=t.o())
{o+=i+","}return o}}


For my response to this (old) question: https://codegolf.stackexchange.com/a/196783/72421 (my linked answer has a commented version of the code and some disclaimers about valid inputs and outputs)

I'm looking for suggestions on how to golf it further. I feel the last function is especially verbose. I managed to make every other function a single expression so I didn't need curly brackets or a return statement, but couldn't figure out how to make the last one not require a while loop.
I think the best way to get rid of the curly brackets is to go recursive.



Original function (46 bytes)

t.s=_=&gt;{o="";while(i=t.o()){o+=i+","}return o}


Recursive version (29 bytes)

t.s=_=&gt;(i=t.o())?i+[,t.s()]:i


The i+[,t.s()] trick saves a byte over i+','+t.s().

Because you stop when t.o() returns null, the result of your original version always ends with a comma. In the new version, we actually append null at the end (that's the :i) but it's coerced to an empty string because of the above trick, leading to the same behavior.