Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // conditional operand selectors
- let log = console.log;
- // log(true && true); // true
- // log(false && true); // false
- // log(true || false); // true
- // log(false || true); // true
- // log(0 && true); //0 - && looks at the first and if it is truthy renders the second
- // log(1 && true); //true
- // log(0 || false); // false
- // log(1 || true); // 1
- // log(0 && "text"); // 0
- // log(1 && "text"); // text
- // log(0 || "text"); // text
- // log(1 || "text"); // 1
- log(false && "text"); //false
- log(true && "text"); //text
- log(false || "text"); // text
- log(true || "text"); // true
- //react will render the following primitives
- // 0, 1, Null, Strings, NaN
- //react will not render
- // booleans, undefined, null, empty strings, empty arrays | objects
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement