Showing posts with label if ? :. Show all posts
Showing posts with label if ? :. Show all posts

Wednesday, October 2, 2013

simple if else

kebiasan standar bahasa pemrograman, akan melakukan fungsi jika maka dengan
if then else dst

tapi ternyata bisa di persingkat dengan sintak berikut :

condition ? valueIfTrue : valueIfFalse

misal

(x==12) ? Benar : Salah

dibaca :

if (x==12)
{benar}
else
{salah}