16
Cadastro = {
"descricao" : "Novo usuário",
"editando" : false
}
It is possible at runtime I get the value of the property by "editing" and use it?
Something like:
Cadastro = {
"descricao" : "Novo usuário",
"editando" : false,
"titulo" : "editando" ? "Editar" : "Criar"
}
I found a way but it is not using the property but creating a variable in the global scope:
window.editando = true;
Cadastro = {
"descricao" : "Novo usuário",
"editando" : false,
"titulo" : (window.editando ? "Editar" : "Novo")
}
Is there any other way to do this? What I want is when the variable value changes the return value "title" also changes.
I’m running some tests, but I believe your answer is correct for this situation.
– c0de
Exactly what I wanted, thank you very much! =)
– c0de