InterviewSolution
Saved Bookmarks
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What will be the output of the following code?<script>let ans = 0 / 0;document.write(ans);</script>(A) 0(B) infinity(C) NaN(D) None of the above |
| Answer» | |
| 2. |
What will be the output of the following code?<script>document.write((0 && 1) || (1 || 0));</script>(A) 0(B) false(C) true(D) 1 |
| Answer» | |
| 3. |
What will be the output of the following 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>(A) Hola(B) Breaking up the code(C) Adios(D) None of the above |
| Answer» | |
| 4. |
What will be the output of the following code?<script>let y = 1;y = typeof x;document.write(typeof y);</script>(A) string(B) null(C) number(D) boolean |
| Answer» | |
| 5. |
What will be the output of the following code?<script>let age = 20;let result = age>18 ? 'Great' : 'Not so great';document.write(result);</script>(A) Great(B) Not so great(C) true(D) None of the above |
| Answer» | |
| 6. |
What will be the output of the following code?<script>var x = [typeof x, typeof y][1];document.write(typeof typeof x);</script>(A) undefined(B) string(C) number(D) boolean |
| Answer» | |
| 7. |
What will be the output of the following code?<script>let ans = 1;document.write( ans === '1');</script>(A) true(B) false(C) 0(D) None of the above |
| Answer» | |
| 8. |
Which logical operator only accepts a single operand?(A) &&(AND)(B) ||(OR)(C) !(NOT)(D) None of the above |
| Answer» | |
| 9. |
Which of the following javascript functions allows you to get user input data?(A) alert(B) prompt(C) confirm(D) None of the above |
| Answer» | |