Can I use a ternary operator when I have more than one operation to perform per case?
For example can I use it here?:
if (dwelling) { dwellin
Yes, see: Conditional (ternary) Operator
var dwelling = true; (dwelling) ? ( dwelling = 'a', //first operation letterDwelling = 'a' //second operation ) : ( dwelling = 'b', letterDwelling = 'b' ); alert(dwelling);
jsfiddle example