SDF Chatter
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
philnash@programming.dev to JavaScript@programming.devEnglish · 1 year ago

Stop nesting ternaries in JavaScript

www.sonarsource.com

external-link
message-square
34
fedilink
32
external-link

Stop nesting ternaries in JavaScript

www.sonarsource.com

philnash@programming.dev to JavaScript@programming.devEnglish · 1 year ago
message-square
34
fedilink
Nesting ternary operators makes code more complex and less clear. Let's investigate other ways to write conditional expressions.
  • hoot@lemmy.ca
    link
    fedilink
    arrow-up
    5
    arrow-down
    3
    ·
    1 year ago

    I’ll be sending this article to my dev teams. It’s right up there with “stop writing Helper classes”.

    • coloredgrayscale@programming.dev
      link
      fedilink
      arrow-up
      7
      ·
      1 year ago

      What’s wrong with helper/util classes?

    • CrayonRosary@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      1 year ago

      NestedTernaryHelper.js

      • hoot@lemmy.ca
        link
        fedilink
        arrow-up
        3
        ·
        1 year ago

JavaScript@programming.dev

javascript@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !javascript@programming.dev
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 3 users / day
  • 10 users / week
  • 71 users / month
  • 285 users / 6 months
  • 11 local subscribers
  • 2.37K subscribers
  • 170 Posts
  • 357 Comments
  • Modlog
  • mods:
  • Erlingur@programming.dev
  • Ategon@programming.dev
  • nick@programming.dev
  • BE: 0.19.8
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org