Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (checkPassword() == true || checkUserName() == true)
- event.preventDefault();
- if ([checkPassword(), checkUserName()].some(Boolean)) {
- // ...
- }
- // checkPassword and checkUserName have side effects, both need to be run
- const invalidPassword = checkPassword()
- const invalidUserName = checkUserName()
- if (invalidPassword || invalidUserName) {
- ...
- }
- 0 0 | 0
- 0 1 | 1
- 1 0 | 1
- 1 1 | 1
- 0 0 | 0
- 0 1 | 0
- 1 0 | 0
- 1 1 | 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement