Teri Teri - 1 year ago 61
Ruby Question

Can someone help me understand != in Ruby?

I'm working on learning Ruby on codecademy. I've gotten to comparators and am sure I'm not understanding !=.
The directions say, exactly "You can also check to see if two values are not equal using the != comparator."
What's the need to check whether something is specifically NOT equal to something else? Does this only apply to numbers? Would anyone be willing to give me 2-3 examples?

Answer Source

Here are some examples of !=

"a string" != "another string"
[1,2,3] != [3,2,1]
{ key: "value" } != { key: "another value" }

Is this what you are looking for?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download