Measures Concepts
GitHub icon

Conditionals

Conditionals - language feature

< >
Example from JavaScript, TypeScript:
if (true) console.log("hi!")
Example from Python, Cython:
if True: print("Hello world")
Example from Elixir:
if true do IO.puts("Hello world") end
Example from Pug:
- var user = {description: 'foo bar baz'} - var authorised = false #user if user.description h2.green Description p.description= user.description else if authorised h2.blue Description p.description. User has no description, why not add one... else h2.red Description p.description User has no description
Example from Slope:
(if positive? 1 -1)
Example from Jule:
if BOOLEAN_EXPRESSION { outln(""Condition is true) }
Example from BALGOL:
EITHER IF A > B$ FWD = 1$ OTHERWISE$ FWD = 0$

Languages with Conditionals include Java, JavaScript, Python, C, C++, PHP, Perl, Ruby, C#, R, Go, Swift, Scala, Ada, Rust, Kotlin, PowerShell, Pascal, Haskell, TypeScript, Lua, Julia, Bash, Objective-C, Elixir, Erlang, Scheme, Dart, Solidity, Verilog, Reason, Crystal, CoffeeScript, F#, OCaml, Groovy, VHDL, Pug, Chapel, ABAP, Dylan, AutoIt, X10, Opa, F*, Clean, SystemVerilog, HCL, Cython, ATS, C3, Bicep, Speedie, Twig, Maxima, janet, Koka, HOPE, Felix, progsbase, Slope, Jule, Angelscript, Pizza, Apex, C2, Flow9, Aardvark, Q#, Ligo, PowerQuery M, JS++, Sophia, BALGOL, fp, nimrod, Oracle Java, Deesel, Tick C, cooC, ADLIB, Extended Pascal

Languages without Conditionals include HTML, XML, JSON, JSON5, Ion, JSONiq, JSON with Comments, Superjson, Jsonnet, Hocon

This question asks: Does the language have conditional statements and/or conditional expressions?

Read more about Conditionals on the web: 1.

HTML of this page generated by Features.ts

View source

- Build the next great programming language Search Add Language Features Creators Resources About Blog Acknowledgements Queries Stats Sponsor Day 605 feedback@pldb.io Logout