Tagged articles
4 articles
Page 1 of 1
Liangxu Linux
Liangxu Linux
May 15, 2024 · Fundamentals

Why Go Skips the Ternary Operator and How to Simulate It

The article explains why the Go language deliberately omits the ternary (?:) operator, compares its usage in Python, JavaScript, and C/C++, shows how to rewrite complex ternary expressions with clear if‑else statements, and presents a functional workaround while outlining the pros and cons of ternary syntax.

Go languagecode readabilityconditional expression
0 likes · 7 min read
Why Go Skips the Ternary Operator and How to Simulate It
php Courses
php Courses
Jul 3, 2023 · Backend Development

Understanding PHP's Ternary Operator

The article explains PHP's ternary operator, covering its basic syntax, equivalence to if‑else statements, usage examples, extensions with multiple statements, nesting, best practices, and common pitfalls, providing clear code illustrations for developers seeking concise conditional expressions.

Code SimplificationPHPconditional expression
0 likes · 6 min read
Understanding PHP's Ternary Operator
WeChatFE
WeChatFE
Apr 25, 2016 · Frontend Development

Mastering UglifyJS: Advanced While, Conditional, Block, and IF Optimizations

This article continues the deep dive into UglifyJS compression, presenting advanced techniques for optimizing while loops, ternary conditional expressions, statement blocks, and IF branches, including rules for removing dead code, merging statements, and transforming structures to achieve maximal size reduction in JavaScript output.

JavaScriptUglifyJScode compression
0 likes · 7 min read
Mastering UglifyJS: Advanced While, Conditional, Block, and IF Optimizations