Hi all,
I can follow the way ruby way to do a ternary but I’m expecting it to be written differently:
correct ternary:
puts 5 < 6 ? "five is less than six !" : "six is not less than five."
Here is what trips me up…
- why “puts” before 5 < 6? I’m trying to evaluate 5 and 6 not put it to the screen yet?
- when I get true or false from the evaluation I then want to put the string to the screen so why not have the put within the true expression area and false expression area of my ternary?
(test ? true expression : false expression)?
So I would expect it to be written like this:
5 < 6 ? puts "five is less than six !" : puts "six is not less than five."
Anyone care to comment on why my logic is failed? ...other than it does not work that way J
- Scott