// This evaluates to 'true'. This is because the first operand
// is true, so it is immediately returned. The second operand
// is never evaluated.
true || false;
// This evaluates to 'true'. This is because the first operand
// is false, so the second operand is returned. In this case,
// the second operand must be evaluated.
false || true;
// This evaluates to false. Since the first operand is false,
// the second operand is not even evaluated.
false && true;
// This evaluates to false. Since the first operand is true,
// the second operand is evaluated. Since this is false, the
// statement evaluates to false.
true && false;
• indexOf( )Searches for the first occurrence of a character or substring. • lastIndexOf( )Searches for the last occurrence of a character or substring.
Normally you call indexOf() with just one argument which is the string or character you are looking for. If you use the two argument version, the second argument tells indexOf() where to start looking in the string,.