CodeX
Published in

CodeX

Replacing Ternary Operators With the Elvis Operator

Because Elvis is the king of rock and roll

In computer programming, if statements are among the most used control statements. They are found in virtually every programming language, and it’s not too uncommon to end up nesting them in one way or another.

$elvis = true;
$ballad = true;

--

--

--

Everything connected with Tech & Code. Follow to join our 900K+ monthly readers

Recommended from Medium

Multibranch Pipeline on Jenkins with Webhook

CoreUI Community — knowledge base & FAQ in one place

Sui DevNet Public Release

Sui DevNet LIVE

Make Documentation API in your repo ? it’s easy ❤️❤️❤️

Toggle Panel for Key Cards

dappKit AMA — questions and answers

dappKit AMA — questions and answers

Porting LittlevGL for a monochrome display

Sketchnote: Game Architecture

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jordi Bassaganas

Jordi Bassaganas

Support me by becoming a Medium member https://bit.ly/3QOrk2X

More from Medium

Introducing Crossbow.js — The world’s first Arrow-Oriented Programming Language.

Programming Jokes to Make Your Day

Signs of a Bad Programmer

Code examples that will make you lose faith in humanity