In javascript re-introduction, I went through 2 examples that I have no clue when or where to use them. Below a quote:
The && and || operators use short-circuit logic, which means whether they will execute their second operand is dependent on the first. This is useful for checking for null objects before accessing their attributes:
var name = o && o.getName();
Or for caching values (when falsy values are invalid):
var name = cachedName || (cachedName = getName());
Will the name contain boolean, if yes, what is the use then? This is might be a noob question, but I wish someone can explain it with an example.