DEV Community


Discussion on: Daily Challenge #66- Friend List

aminnairi profile image

I see we got a similar solution you and I!

I think you can even shorten (if I'm not mistaken) your solution by reducing one .map down and doing like me the surrounding in your first call to the .map method!

Should such a .surround method exist in String.prototype? I have came accross several cases where I would need it like in a WYSIWYG editor. But I don't want to risk proposing such a method to the community haha!

Good take btw!