Could you please help me to understand how to move the consonant cluster to the end of the word.
let str = 'schwartz'
let startwith = '^[aieouAIEOU].*'
let matched = str.match(startwith)
let store = []
if(!matched){
string = str[0]
m = str.replace(str.charAt(0), '')
store.push(m)
console.log(store + string + 'way')
}
else{
console.log(str +'ay')
}
Aucun commentaire:
Enregistrer un commentaire