When pulling a cookie value, the previous version was checking if it existed first (via REGEX) and then executing the same regex again to pull matches. While the .test() to check if it exists is going to be slightly quicker, it's still parsing the entire cookie set twice which adds overhead when reading an individual cookie.
When pulling a cookie value, the previous version was checking if it existed first (via REGEX) and then executing the same regex again to pull matches. While the
.test()
to check if it exists is going to be slightly quicker, it's still parsing the entire cookie set twice which adds overhead when reading an individual cookie.