pstein Posted August 11, 2017 Share Posted August 11, 2017 (edited) In many other programming languages (e.g. Java) there is a function like: ((a < b ) ? "lower" : "greater")? which outputs "lower" if the value of variable a is lower than the value of variable b. Otherwise "greater" Is there a similar function in Javascript? Peter Edited August 11, 2017 by pstein Link to comment Share on other sites More sharing options...
dsonesuk Posted August 11, 2017 Share Posted August 11, 2017 Conditional (Ternary) Operator https://www.w3schools.com/js/js_comparisons.asp Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now