diff --git a/16. Make string to slug/index.html b/16. Make string to slug/index.html new file mode 100644 index 0000000..6bc2b84 --- /dev/null +++ b/16. Make string to slug/index.html @@ -0,0 +1,12 @@ + + + + + + + Document + + + + + \ No newline at end of file diff --git a/16. Make string to slug/main.js b/16. Make string to slug/main.js new file mode 100644 index 0000000..1f259a4 --- /dev/null +++ b/16. Make string to slug/main.js @@ -0,0 +1,8 @@ +function textToSlug(text) { + return text + .toLowerCase() + .replace(/[^\w ]+/g,'') + .replace(/ +/g,'-'); +} + +console.log(textToSlug("I am tanvir")); \ No newline at end of file