Hello all I have an ascii image.
<pre class="bear"> _ _
(c).-.(c)
/ ._. \
__\( P )/__
(_.-/'L'\-._)
|| A ||
_.' `Y' '._
(.-./`-'\.-.)
`-' `-' </pre>
I am wrapping each character with a span using the following function
const bear = document.querySelector('.bear')
bear.innerHTML = sparanWrap(bear.textContent)
const sparanWrap = (word) => {
return [...word].map((letter) => `<span>${letter}</span>`).join('')
}
The ascii image contains the characters 'P','L','A','Y' which I would lke to wrap with a different span:
<span class="play">P</span>
<span class="play">L</span>
<span class="play">A</span>
<span class="play">Y</span>
I'm guessing I should be using filter here but not quite sure how to do that?
Thanks in advance
letteris one of your "special" characters and return a different string.