If you want to call the function, of course it works, but the syntax would not be this, it would look like this:
if (a > 1) {
Save();
} else {
NoSave();
}
But if you want to define functions conditionally, there you can not, at least not in this way. You could even define two anonymous functions, like this:
var salvar;
if (a > 1) {
salvar = function() { //faz alguma coisa que seria o você quer no Save()};
} else {
salvar = function() { //faz outra coisa ou eventualmente não faz nada, seria o NoSave()};
}
Then somewhere you would call salvar()
.
It probably has a better way of doing what you need but without details I could only suggest this.