programming.dev
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
philnash to JavaScriptEnglish · 2 years ago

Stop nesting ternaries in JavaScript

www.sonarsource.com

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

Stop nesting ternaries in JavaScript

www.sonarsource.com

philnash to JavaScriptEnglish · 2 years ago
message-square
34
link
fedilink
Nesting ternary operators makes code more complex and less clear. Let's investigate other ways to write conditional expressions.
  • CameronDev
    link
    fedilink
    arrow-up
    3
    ·
    2 years ago

    Your probably right, that looks quite desirable.

JavaScript

javascript

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: [email protected]
Visibility: Public
globe

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

  • 1 user / day
  • 2 users / week
  • 57 users / month
  • 282 users / 6 months
  • 684 local subscribers
  • 2.44K subscribers
  • 177 Posts
  • 384 Comments
  • Modlog
  • mods:
  • Erlingur
  • Ategon
  • nick
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org