Answers for "ternary operator online"

3

ternary function javascript

var variable;
if (condition)
  variable = "something";
else
  variable = "something else";

//is the same as:

var variable = condition ? "something" : "something else";
Posted by: Guest on May-20-2020
0

ternary operator online

if  (isNaN(number))  return false
   if  (number >0) {
       return number
   } else {
       return (`${Math.abs(number)}`)
   }
Posted by: Guest on July-15-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language