Are you tied to Java Script? or will you accept an alternate solution?
If you are open to Power Query then
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Lowercased Text" = Table.TransformColumns(Source,{{"Header", Text.Lower, type text}}),
#"Added Custom" = Table.AddColumn(#"Lowercased Text", "Custom", each Text.Remove([Header],{"0".."9"})),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom.1", each Text.Remove([Custom],{"?","!"})),
#"Trimmed Text" = Table.TransformColumns(#"Added Custom1",{{"Custom.1", Text.Trim, type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Trimmed Text"," ","-",Replacer.ReplaceText,{"Custom.1"}),
#"Removed Other Columns" = Table.SelectColumns(#"Replaced Value",{"Custom.1"})
in
#"Removed Other Columns"
Bookmarks