Skip to content

Instantly share code, notes, and snippets.

@kat0h
Created September 24, 2022 13:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kat0h/8a6b0095e7fdc4572ae68bfaa2e2dd43 to your computer and use it in GitHub Desktop.
Save kat0h/8a6b0095e7fdc4572ae68bfaa2e2dd43 to your computer and use it in GitHub Desktop.
a
const array1=[1,2,3,4,5,6]
const array2=array1.a||(z=>(F=>l=>z(X=>m=>m[1].length==0?[F(m[0]),[]]:[F(m[0]),X(m[1])])(l))(i=>i%2?[i,i,i]:[i,i])(z(a=>l=>l.length==1?[l[0],[]]:[l[0],a(l.slice(1))])(array1)))(A=>(B=>A(c=>B(B)(c)))(B=>A(c=>B(B)(c)))).flat(1/0)
console.log(array2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment