JSFiddle - React, Tailwind, and code Playground

by Joe Saad

JavaScript

const pg = "phonePage"

var result = pg.replace(/([A-Z])/g, "-$1").toLowerCase(); 
console.log(result);