DEV Community

Discussion on: Daily Challenge #206 - Pound Means Backspace

Collapse
 
sabbin profile image
Sabin Pandelovitch

Another JS solution

const cleanString = string => string.split('').reduce((a,v)=> v==="#" ? a.substr(0,a.length-1) : a+=v,'');