Строка для пули const slugify = str => str .toLowerCase() .trim() .replace(/[^\w\s-]/g, '') .replace(/[\s_-]+/g, '-') .replace(/^-+|-+$/g, ''); slugify('Hello World!'); // 'hello-world' Текст и строки JavaScript