Skip to main content
added 557 characters in body
Source Link
NinjaBearMonkey
  • 10.4k
  • 3
  • 38
  • 67

JavaScript ES6, 47 bytes

f=s=>s.replace(/./g,(e,i)=>s.indexOf(e)<i?'':e) 

Test UI coming soonThe test below works on all browsers.

f=function(s){ return s.replace(/./g,function(e,i){ return s.indexOf(e)<i?'':e }) } run=function(){document.getElementById('output').innerHTML=f(document.getElementById('input').value)};document.getElementById('run').onclick=run;run()
<input type="text" id="input" value="Type unique chars!" /><button id="run">Run</button><br /> <pre id="output"></pre>

JavaScript ES6, 47 bytes

f=s=>s.replace(/./g,(e,i)=>s.indexOf(e)<i?'':e) 

Test UI coming soon.

JavaScript ES6, 47 bytes

f=s=>s.replace(/./g,(e,i)=>s.indexOf(e)<i?'':e) 

The test below works on all browsers.

f=function(s){ return s.replace(/./g,function(e,i){ return s.indexOf(e)<i?'':e }) } run=function(){document.getElementById('output').innerHTML=f(document.getElementById('input').value)};document.getElementById('run').onclick=run;run()
<input type="text" id="input" value="Type unique chars!" /><button id="run">Run</button><br /> <pre id="output"></pre>

Source Link
NinjaBearMonkey
  • 10.4k
  • 3
  • 38
  • 67

JavaScript ES6, 47 bytes

f=s=>s.replace(/./g,(e,i)=>s.indexOf(e)<i?'':e) 

Test UI coming soon.