MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add loop quicks test

+44
+44
examples/quirks.txt
··· 1 + print: 2 + (i=0,f=_=>i<10&&(console.log(i++),f``))`` 3 + 4 + concat: 5 + (s='',i=0,f=_=>i<10&&(s+=i++,f``),f``,s) 6 + 7 + timeout: 8 + void function f(i){i<5&&setTimeout(f,0,i+1,console.log(i))}(0) 9 + 10 + comma: 11 + (f=i=>(i<5&&(console.log(i),f(i+1)),0))(0) 12 + 13 + getter (has to be run twice?): 14 + ({get n(){for(var i=0;i<5;)console.log(i++)}}).n 15 + 16 + proxy: 17 + (p=new Proxy([],{get:(t,k)=>k<5?(console.log(+k),p[+k+1]):0}))[0] 18 + 19 + reflect: 20 + new Proxy([],{get:(t,k,r)=>k<5?(console.log(+k),r[+k+1]):0})[0] 21 + 22 + symbol.toPrimitive: 23 + +{i:0,[Symbol.toPrimitive](){return this.i<5?(console.log(this.i++),+this):0}} 24 + 25 + toString: 26 + ''+{i:0,toString(){return this.i<5?(console.log(this.i++),this+''):''}} 27 + 28 + replace: 29 + 'xxxxx'.replace(/x/g,(_,i)=>console.log(i)) 30 + 31 + array: 32 + [...Array(10)].map((_,i)=>console.log(i)) 33 + 34 + error stack: 35 + (f=i=>{try{if(i<5)throw i}catch(e){console.log(e),f(e+1)}})(0) 36 + 37 + symbol.iterator: (no generators) 38 + [...{*[Symbol.iterator](){for(let i=0;i<5;)yield console.log(i++)}}] 39 + 40 + promise: 41 + void async function f(i){i<5&&await f(i+1,console.log(i))}(0) 42 + 43 + sloppy with: 44 + with({i:0}){while(i<5)console.log(i++)}