Created
October 31, 2012 13:50
-
-
Save LucasArruda/3987136 to your computer and use it in GitHub Desktop.
Can someone guess what this code does?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
catMedia = (categoryId==157)?getCategoryMedia1():getCategoryMedia(); | |
// ... |
Sim, @djhonyy. Isso é uma maneira de fazer um if/else.
Mas na verdade eu estava perguntando 2 coisas.
- O que é 157, além de uma constante mágica?
- Qual a diferença entre um metodo blablabla() e blablabla1()?
Então, o código não esta nada legível (e não é por causa da falta do if).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if (categoryId == 157) {
catMedia = getCategoryMedia1(); // São métodos diferentes
} else {
catMedia = getCategoryMedia();
}