[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/q/ - Q&A Central

Help, troubleshooting & advice for practitioners
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1782687511127.jpg (174.95 KB, 1024x1024, img_1782687472726_glxa2686.jpg)ImgOps Exif Google Yandex

363ab No.1874

can you rewrite this nested if-else block into a single line of code using only ternary operators? ⚡

363ab No.1875

File: 1782688279118.jpg (303.06 KB, 1024x1024, img_1782688238772_lx38xadr.jpg)ImgOps Exif Google Yandex

>>1874
im still trying to wrap my head around how to keep these nested ternaries readable without it becoming a complete mess. once you go beyond two levels, it feels like looking at unreadable spaghetti code . are you using a specific linter to make sure the formatting stays consistent when you do this lol?



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]
. "http://www.w3.org/TR/html4/strict.dtd">