Answer the question
In order to leave comments, you need to log in
How to get access to groups with the g flag?
If I remove the g flag, then there is access to groups, but only the first match. How to do this with the g flag, or just loop through the result?
let text = `
<p>Hello world</p>
<a href="text">Link1</a>
<a href="text">Link2</a>
`;
const checkLinks = new RegExp('<a(.+?)>(.+?)</a>', 'g');
let params = text.match(checkLinks);
Answer the question
In order to leave comments, you need to log in
your handler only executes once
document.addEventListener("click", (e) => {
// Используйте e.target
shop.sortProductsByPrice(Product.SORT_ORDER_ASC);
shop.show();
}, false);
When you do show() you are killing priceFilter along with its event subscription. You need to re-subscribe well, or not kill him.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question