fork download
  1. // your code goes here
  2. const s = "あ い&う え"
  3.  
  4. let out = s.replace(/&#(\d{1,5});/g, (...matches) => String.fromCharCode(parseInt(matches[1])))
  5. .split(/\s| /).join(" ")
  6.  
  7. console.log(out)
Success #stdin #stdout 0.03s 16864KB
stdin
Standard input is empty
stdout
あ い&う え