Using || to set default values

by peterbenoit

JavaScript

var color = "yellow";
var banana = (color == "red") || "fruit";

alert(banana);