Skip to content

Conversation

@aadil42
Copy link

@aadil42 aadil42 commented May 31, 2024

function dogs(x) {
    if (x) {
      if (z) {
        return y;
      }
    } else {
      return z;
    }
  }

We can shorten it like this so it's easier to read.

  function dogs(x) {
     if(x && z) return y;
     if(!x) return z;
  }

We can shorten it like this so it's easier to read.
    function dogs(x) {
      if (x) {
        if (z) {
          return y;
        }
      } else {
        return z;
      }
    }
/////////////////////////////////////////////////////
function dogs(x) {
   if(x && z) return y;
   if(!x) return z;
}
Copy link
Collaborator

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is both much harder to read, and violates our own style guide in multiple ways.

@ljharb ljharb marked this pull request as draft May 31, 2024 04:35
@ljharb ljharb closed this May 31, 2024
@aadil42
Copy link
Author

aadil42 commented May 31, 2024

Okay cool.

@aadil42 aadil42 deleted the patch-1 branch May 31, 2024 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants