What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-18 08:58:21
convert normal if condition to ternary operator
//ternary operator syntax and usage: condition ? doThisIfTrue : doThisIfFalse //Simple example: let num1 = 1; let num2 = 2; num1 < num2 ? console.log("True") : console.log("False"); // => "True" //Reverse it with grea... Add solution -
Shell/Bash 2021-08-31 03:31:02
awk if else statement
# Basic syntax: awk 'BEGIN {if(condition) outcome}' # if awk 'BEGIN {if(condition_1) outcome_1; else outcome_2}' # if else awk 'BEGIN {if(condition_1) outcome_1; else if(condition_2) outcome_2}' # if else if # Example usage: awk 'BEGIN {if(2>3) print ... Add solution