DEV Community

dev.to staff
dev.to staff

Posted on

Daily Challenge #131 - Remove Anchor from URL

Complete the function/method so that it returns the URL with anything after the anchor (#) removed.

Examples

# returns 'www.codewars.com'
remove_url_anchor('www.codewars.com#about')

# returns 'www.codewars.com?page=1'
remove_url_anchor('www.codewars.com?page=1')


This challenge comes from jhoffner on CodeWars. Thank you to CodeWars, who has licensed redistribution of this challenge under the 2-Clause BSD License!

Want to propose a challenge idea for a future post? Email yo+challenge@dev.to with your suggestions!

Top comments (7)

Collapse
 
thepeoplesbourgeois profile image
Josh •
const unAnchor = (url) => url.split("#")[0]
Collapse
 
thepeoplesbourgeois profile image
Josh •

How fast is my implementation?

Some comments may only be visible to logged-in visitors. Sign in to view all comments.