score:1

Accepted answer
<script src="https://unpkg.com/react@17.0.2/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@17.0.2/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/@babel/standalone@7.15.7/babel.min.js"></script>

<div id="main"></div>

<script type="text/babel" data-type="module" data-presets="typescript,react">

const nickName = 'Laruo May';

const element = (
  <div>
    {[...nickName].map((letter, index) => (
      <div key={`${index}${letter}`}>{letter.replace(' ', '*-*')}</div>
    ))}   
  </div>
);

ReactDOM.render(element, document.getElementById('main'));

</script>

score:0

let nickName = "Laruo May";
let spaicing = nickName.replaceAll(" ", "-").split("");

console.log(spaicing)

Related Query

More Query from same tag