Web technologies Questions | JavaScript Course Quiz 2 | Question 6

What will be the output of the following code?

filter_none

edit
close

play_arrow

link
brightness_4
code

<script>
 let i = 30;
  if( i == 10 || i > 20){
    console.log('Hola');
  }else if( i == 5){
    console.log('Breaking up the code');
  }else{
    console.log('Adios');
 }
</script>

chevron_right


(A) Hola
(B) Breaking up the code
(C) Adios
(D) None of the above


Answer: (A)

Explanation: The if() statement will be executed if the condition in the bracket returns true otherwise the else statement is executed.

Quiz of this Question

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.

About immukul

Executive Software Developer at Cavisson Systems