Simple If Statement in JavaScript
Level 246 keystrokes
This checks if x is greater than 5 and outputs 'big' if true.
JavaScript code
// Declare a variable x with value 101let x = 10;// if statement checks a condition in parentheses// If x > 5 is true, the code block executes2if (x > 5) { // This runs because 10 > 5 is true3 console.log("big");4}Output
big
Practice typing this code. Results are not recorded in the rankings.
Symbols in this code
The symbols you type in this JavaScript code and how often they appear.
;× 2"× 2(× 2)× 2.× 1{× 1}× 1=× 1>× 1