I would like to edit javascript from this post and use regexp inside map, if possible: like string starts with "xyz", but that syntax is not working for me :
var anchorMap = {
    "A": "/products/A",
    "B": "/products/B",
    /^xyz: "/products/xyz"
}
is that possible ? Or what is the easiest way to implement such logic ?
 
     
    