+ 2

Ternary operator syntax for ruby?

26th Nov 2017, 2:54 PM
🐙evil octopus
🐙evil octopus - avatar
3 Respuestas
+ 2
x=1, y=1 ( x == y ) ? 'equal' : 'not equal' This evaluates to 'equal'. x=1, y=0 ( x == y ) ? 'equal' : ' not equal' and this for 'not equal'
28th Nov 2017, 5:38 AM
Jakub Miziński
Jakub Miziński - avatar
0
x=1, y=1 ( x == y ) ? 'equal' : 'not equal' This evaluates to 'equal'. x=1, y=0 ( x == y ) ? 'equal' : ' not equal' and this for 'not equal'
16th Feb 2018, 1:03 PM
Васильев Михаил
Васильев Михаил - avatar
0
x=1, y=1 ( x == y ) ? 'equal' : 'not equal' This evaluates to 'equal'. x=1, y=0 ( x == y ) ? 'equal' : ' not equal' and this for 'not equal'
16th Feb 2018, 3:10 PM
Васильев Михаил
Васильев Михаил - avatar