3
bug123
5y

which is better

Comments
  • 16
    The second one probably.
  • 22
    Anyone using the first version should be instantly hit by a falling piano.
  • 17
    Neither. There's a space just after opening parenthesis.
  • 2
    Either the first with an additional line break or the second
  • 17
    None, and it bugs me in all the ways.

    There's no space between if and opening (
    There's a space between opening ( and data
    There's no space between closing ) and opening {
    Loose equality is being used
    The value of data is not being console logged
  • 3
    If(c) do{
    Stufff()
    }
    While (0)
  • 1
    @haze Thank you. Also there's no space before the open brace
  • 2
    Neither they're both js
  • 4
    data == 1 ? console.log.apply(this, [data]) : void(0);

    the only right way, believe me.
  • 3
    It should be, (data == 1) ? console.log(data) : '';
  • 1
    @Mrbarnk Equality has higher precedence than the ternary operator
  • 5
    Neither, this is the best:
    if (data == 1)
    console.log(data);
  • 2
    @-red nope I don't think so. No other Lang would use console.log unless it was a package which would be stupid to do so bc it's a web MDN method
  • 4
    Best version is

    @highlight
    (data === 1) && console.log(1)
  • 2
    @python3
  • 7
    Whatever the fuck the prettifier and eslint formatted the code when I save
  • 2
    The first one troubles me alot.
  • 1
    @devTea unfortunately can not upvote more.

    Nobody cares about your preference. Just make it consistent..
  • 1
    @ddephor Well, I use the first one and I dont see a falling pia...
    Wait how did it get so dark all of a sudden?
    *Looks up and sees falling piano*
    FUCK!
  • 2
    Python is
  • 1
    @-red again, bad design my friend. That's like an edge case of edge cases
  • 2
    if (data == 1) => console.log(1)
    what now
  • 1
    @python3 lol
Add Comment