https://www.tecforest.com.br/?p=2071
Declarando if e else em JavaScript