Avatar of MJ
Flag for United States of America

asked on 

JavaScript Underscore Library _.map function using RegX or _filter?

Given  the following code segments:
 __.map(lookupEvents,function(value,key) {
            if(pathname.indexOf(key)!==-1) {returnValue.push(value);}

Open in new window

Is there a way to use a regX or other approach, possibly _filter, so both event29 and event32 are not set for URLs containing "checking-offer-confirmation"? I only want to set event32 for  "checking-offer-confirmation". I'm new to Underscore so not quiet sure how to handle this particular situation?

Web DevelopmentRegular ExpressionsJavaScript

Avatar of undefined
Last Comment
Julian Hansen

8/22/2022 - Mon