diff options
Diffstat (limited to '')
-rw-r--r-- | _pastebins/2021-04-03-javascript-naive-slugify.md | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/_pastebins/2021-04-03-javascript-naive-slugify.md b/_pastebins/2021-04-03-javascript-naive-slugify.md index ce038fd..f765495 100644 --- a/_pastebins/2021-04-03-javascript-naive-slugify.md +++ b/_pastebins/2021-04-03-javascript-naive-slugify.md @@ -4,6 +4,8 @@ title: JavaScript naive slugify date: 2021-04-03 +updated_at: 2021-08-15 + layout: post lang: en @@ -15,8 +17,8 @@ ref: javascript-naive-slugify ```javascript const s = "Pézão: açaí, saci-pererê."; -function slugify(s) { - return s +const slugify = s => + s .toLowerCase() .replaceAll(":", "") .replaceAll(".", "") @@ -33,7 +35,6 @@ function slugify(s) { .replaceAll("ú", "u") .replaceAll("ü", "u") .replaceAll("ç", "c"); -} console.log(slugify(s)); ``` |