Skip to main content
Commonmark migration
Source Link

#JavaScript (ES6), 33 bytes

JavaScript (ES6), 33 bytes

Saved 1 byte thanks to @ShieruAsakoto

I/O format: array of words.

a=>a.map(g=w=>w&&w+g(w.slice(1)))

Try it online!


#JavaScript (ES6), 35 bytes

JavaScript (ES6), 35 bytes

I/O format: array of words.

a=>a.map(w=>w.replace(/./g,"$&$'"))

Try it online!

#JavaScript (ES6), 33 bytes

Saved 1 byte thanks to @ShieruAsakoto

I/O format: array of words.

a=>a.map(g=w=>w&&w+g(w.slice(1)))

Try it online!


#JavaScript (ES6), 35 bytes

I/O format: array of words.

a=>a.map(w=>w.replace(/./g,"$&$'"))

Try it online!

JavaScript (ES6), 33 bytes

Saved 1 byte thanks to @ShieruAsakoto

I/O format: array of words.

a=>a.map(g=w=>w&&w+g(w.slice(1)))

Try it online!


JavaScript (ES6), 35 bytes

I/O format: array of words.

a=>a.map(w=>w.replace(/./g,"$&$'"))

Try it online!

switched to array of words
Source Link
Arnauld
  • 197.7k
  • 20
  • 179
  • 650

#JavaScript (ES6), 4533 bytes

Saved 1 byte thanks to @ShieruAsakoto

I/O format: array of words.

s=>sa=>a.replacemap(/\S+/g,g=s=>s?s+gg=w=>w&&w+g(sw.slice(1)):s)

Try it online!Try it online!


#JavaScript (ES6), 4635 bytes

I/O format: array of words.

s=>sa=>a.replacemap(/\S+/g,s=>sw=>w.replace(/./g,"$&$'"))

Try it online!Try it online!

#JavaScript (ES6), 45 bytes

s=>s.replace(/\S+/g,g=s=>s?s+g(s.slice(1)):s)

Try it online!


#JavaScript (ES6), 46 bytes

s=>s.replace(/\S+/g,s=>s.replace(/./g,"$&$'"))

Try it online!

#JavaScript (ES6), 33 bytes

Saved 1 byte thanks to @ShieruAsakoto

I/O format: array of words.

a=>a.map(g=w=>w&&w+g(w.slice(1)))

Try it online!


#JavaScript (ES6), 35 bytes

I/O format: array of words.

a=>a.map(w=>w.replace(/./g,"$&$'"))

Try it online!

Source Link
Arnauld
  • 197.7k
  • 20
  • 179
  • 650

#JavaScript (ES6), 45 bytes

s=>s.replace(/\S+/g,g=s=>s?s+g(s.slice(1)):s)

Try it online!


#JavaScript (ES6), 46 bytes

s=>s.replace(/\S+/g,s=>s.replace(/./g,"$&$'"))

Try it online!