Ternary Operator, GCD, Prime Numbers

javascript dev.to

1)Ternary Operator A ternary operator is a shorthand conditional operator ( condition ? exprIfTrue : exprIfFalse) that evaluates a condition and returns one of two values based on whether the result is true or false, acting as a concise replacement for simple if-else statements. Python a = 10 b = 5 c = 8 smallest = a if (a b and a c) else (b if b c else c) print("Smallest number is:", smallest) Output Javascript let a = 100; let b = 55; let c = 67; let smallest = (a b

Read Full Tutorial open_in_new
arrow_back Back to Tutorials