-2
I would like to make some script that returns something like
MENSAGEM_SUCESSO = 'Registro inserido com sucesso';
MENSAGEM_ERRO = 'Problemas ao inserir o registro!';
Soon in some Function call these "constants":
function Salvar() {
// se salvou com sucesso
Alerta(MENSAGEM_SUCESSO, 'Mensagem'); // função hipotetica que exibe um alert em bootstrap no html
}
I would like to parameterize the messages in a file js
What’s better? const? Let? or just a string file.
I need some guidance.
But
const
does not solve your problem? Why not?– Woss
If it does, what is the doubt? It’s not clear what you need to know. If it is only the "best way", can be considered as based on opinions, at least if you do not list all the requirements that the solution should meet, in which case who knows can evaluate the best.
– Woss