)
}
}
)
(
}
{
)
)
(
)
(
(
{
}
)
(
)
}
)
)
{
(
(
)
)
}
)
(
}

Nonsense Words Golfed

  1. vow = 'aeiou'.split``
  2. con = 'bcdfghjklmnpqrstvwxyz'.split``
  3.  
  4. R = _ => Math.random()
  5. r = a => a[~~(R() * a.length)]
  6.  
  7. part = _ => r(con) + r(vow) + (
  8.   R() < .5 ? r(vow) : ''
  9. )
  10.  
  11. wrd = _ => {
  12.   n = ~~(R() * 3) + 1
  13.   s = ''
  14.   for (i = n; i--;) 
  15.     s += part()
  16.  
  17.   return s + ' '
  18. }
  19.  
  20. for(k = 30; k--;) 
  21.   document.body.innerHTML += wrd()

Some nonsense words…

// humor // strings

Alphabet Array Golfed

  1. l=[]
  2. for(i=26;i--;)l[i]=(10+i).toString(36)
  3. console.log(l)

A nasty golfed way to fill an array with letters a-z.

I usually do (as seen in another post):

  1. let letters = 'abcdefghijklmopqrstuvwxyz'.split``

Bat Signal

  1. document.body.innerHTML = '<pre>'+`n2zh2
  2. f8l2b2l8
  3. b8pep8
  4. 7cpepc
  5. 5ijiji
  6. 3yyq
  7. 0
  8. 0
  9. 0
  10. 3yyq
  11. 5afy8fa
  12. 98f69a96f8
  13. f4f2d6d2f4`.replace(/./g,c=>'* '[(n=parseInt(c,36))&1].repeat(n/2||49))
           *                         *
       ****          *     *          ****
     ****            *******            ****
   ******            *******            ******
  *********         *********         *********
 ***********************************************
*************************************************
*************************************************
*************************************************
 ***********************************************
  *****       *********************       *****
    ****       ***    *****    ***       ****
       **       *      ***      *       **

Fun js codegolf answer from user arnauld… Whole thread is very fun…

Martin Kleppe’s Golfed Blobs Quine

  1. <pre id=p style=background:#000><svg onload='setInterval(f=n=>
  2. {for(t++,o=i=1;i++<476;o+=i%30?([(f+"")[i%195],"o"][c=0|(h=v=>
  3. (M=Math).hypot(i/30-8+3*M.sin(t/8/v),i%30/2-7+4*M.cos(t/9/v)))
  4. (7)*h(9)*h(6)/52]||".").fontcolor(c?c>2:n):"\n");p.innerHTML=o},t=1)'>

Great golfed snippet from Martin Kleppe – can’t wait to fork it… 😀

This was updated a bit later to be even smaller:

  1. <body onload='setInterval(f=n=>{for(t++,o=i=1;i++<476;o+=i%30?([(f+f)[i],"o"][c=0|(h=v=>(M=Math).hypot(i/30-7+3*M.sin(t/8/v),i%30/2-7+4*M.cos(t/9/v)))(7)*h(9)*h(6)/52]||".").fontcolor(c?c>2:n):"\n");p.innerHTML=o},t=1)'bgcolor=X><pre id=p>
// dom // golfed // graphics // hacks // html // humor // javascript // math // strings // tricks

Alphabet Array JavaScript

  1. const alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('')
  2. console.log(alphabet);
  3. // outputs: ['a', 'b', 'c', ... 'z']

Create an array of the alphabet.

Splitting a string with an empty string results in each character being placed into a slot in the new array.

snippet.zone ~ 2021-24 /// {s/z}