As from class to remove the modifier using js?

I have many classes like this

toggle-....
toggle-....
toggle-....
toggle-....

using JS as I go through the whole document and they have to remove only these values in classes such as:
To such a class of "toggle-menu-navigagation" became: "menu-navigagation" ?
June 3rd 19 at 19:24
2 answers
June 3rd 19 at 19:26
Solution
document.querySelectorAll('[class*="toggle-"]').forEach(n => {
 n.className = n.className.replace(/toggle-/g, ")
})
June 3rd 19 at 19:28
Solution
const array = document.querySelectorAll('[class*="toggle-"]') // Taken from the version @0xD34F 

Array.from(array).forEach(el => {
 const name = el.className.split('toggle-').join(")
el.classList.remove(el.className)
el.classList.add(name)
})


Working example - https://jsfiddle.net/Svupol/34jmxL97/10/

Find more questions by tags JavaScript