Уровень 0 · материалов: 3
В кластер входят документы, описывающие внутренние механизмы обработки текстовых данных и регулярных выражений в JavaScript, и не входят документы по другим аспектам языка или другим технологиям.
Общие признаки: язык программирования JavaScript, манипуляция строками, регулярные выражения, управление памятью и производительность
Группа выше: Работа с данными и текстом в JavaScript
Смысл: The main idea is that JavaScript engines optimize string slicing by keeping references to the original larger strings, which can cause unexpected memory leaks; developers should manually copy small, long-lived substrings to allow the original large strings to be garbage collected.
Sliced strings in JavaScript can unexpectedly retain references to massive parent strings, causing memory leaks that can be fixed by manually forcing a string copy.
Смысл: The main idea is to demonstrate the evolution of string handling in JavaScript—from dangerous manual concatenation to the use of structured template engines—emphasizing security (XSS prevention), maintainability (localization), and functional elegance.
A technical tutorial disguised as a dialogue that teaches the importance of template engines and automatic data escaping in JavaScript to prevent security vulnerabilities.
Смысл: The main idea is to warn JavaScript developers about the stateful nature of regular expressions using the global (`g`) flag, specifically how the `lastIndex` property causes the `test()` method to return alternating results when reused on the same string.
Using the global flag (`g`) in a reused JavaScript RegExp object causes `test()` to start searching from the last match position, leading to incorrect results.