Skip to content

Commit

Permalink
tonic fix 2
Browse files Browse the repository at this point in the history
  • Loading branch information
gigiodelchiaro committed Jan 14, 2025
1 parent 0197d06 commit b32211f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tonic.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ function tonica(wordSeparated) {
return 1;
}

return 2 + wordSeparated.join(" ").match(/-/g).length;
return 2 + (wordSeparated.join(" ").match(/-/g) || []).length;
}
console.log("Identificador de sílabas tônicas carregado com sucesso!");

0 comments on commit b32211f

Please sign in to comment.