JavaScriptJavaScript · Lesson 04Conditionalsif/else, ternary, switch and guard clauses.Video tutorialTrack course · freeCodeCampJavaScript Full Course for Beginners Speed0.75x1x1.25x1.5x2x Skip intro Next lessonWatch 00:00 · 1 checkpoints Watch on YouTube More on this topic Transcript & captions .txt2/200:00Conditionals. if/else, ternary, switch and guard clauses.00:05Try it yourself — edit the sample and run it in the browser.Try it yourself Copy Reset Run<pre id="o"></pre> <script> function rank(level){ if (level >= 400) return 'Legendary'; if (level >= 200) return 'Master'; return 'Rookie'; } const kd = 3.2; const label = kd > 2 ? 'Elite' : 'Solid'; let mode = 'sniper'; let tip; switch (mode) { case 'sniper': tip = 'Hold long lanes'; break; case 'smg': tip = 'Rush objectives'; break; default: tip = 'Play the map'; } o.textContent = rank(400) + '\n' + label + '\n' + tip; </script>Knowledge check0/1 answeredWhat does a missing break in a switch cause?An errorFall-through to the next caseNothingMark as complete PreviousOperators & ComparisonNext Loops & Iteration