CoderMantra

Menu
  • Home
  • Tutorial
    • Core Java
    • Python Tutorial
    • Data Structures
    • C Programming
  • AI Tools
  • Career & Skills
  • Coding & Career
  • Quiz
  • Blog

javascript-exam

0 votes, 0 avg
611
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

JavaScript Questions

1 / 15

1. Which of the following is the correct output for the following JavaScript code:

var grade='Z';  
var result;  
switch(grade)  
{  
case 'A':  
        result+="10";  
case 'B':  
        result+=" 9";  
case 'C':  
        result+=" 8";  
default:  
        result+=" 100";  
}  
document.write(result);  

2 / 15

2. What will be the output of the following JavaScript code?

var cars = ["Honda","Hyundai","Mahindra"];
 
 var result = cars.shift();
 
 document.writeln("Result: ", cars);

3 / 15

3. What will be the output of the following code snippet?

let sum = 0; 
const a = [1, 2, 3];
a.forEach(getSum);
print(sum);
function getSum(ele) {
   sum += ele;
}

4 / 15

4. Which JavaScript statements when embedded in an HTML page can respond to user events such as mouse clicks, form input and page navigation

5 / 15

5. The correct syntax to write "Hello World" in javascript.

6 / 15

6. What will be the result or type of error if p is not defined in the following JavaScript code snippet?

console.log(p)

7 / 15

7. What will be the output of the following JavaScript code?

let x = "10";
    let y = + x;
    
    document.write(typeof y);

8 / 15

8. Which is the correct syntax to call an external JavaScript file in the current HTML document?

9 / 15

9. Which of the following values is not a Boolean false?

10 / 15

10. What is the use of the noscript tag in Javascript?

11 / 15

11. What does … operator do in JS?

12 / 15

12. How are windows, tabs, iframes, and frames treated according to client-side javascript?

13 / 15

13. Which of the following is the method used to add an element to the desired location?

14 / 15

14. What will be the output of the following JavaScript code?

var arr = [7, 5, 9, 1];  
var min = Math.min.apply(null, arr);  
document.writeln(min);

15 / 15

15. Which of the following methods can be used to display data in some form using Javascript?

Your score is

LinkedIn Facebook VKontakte
0%

By Wordpress Quiz plugin

Category

  • AI
  • AI Tools
  • Assignments
    • C Language Assignments
    • C++ Assignments
    • Java Assignments
    • Python Assignments
  • C Programming
  • c-plus-plus-Assignments
  • C++
  • Career & Skills
  • Coding & Career
  • Coding + AI
  • Core Java
  • Data Structure
  • Data Structure In C++
  • Data Structures
  • Freelancing & Career
  • How To
  • Interview
  • Java Programming
  • Java Programs
  • Java-Assignments
  • node js questions
  • nodejs assignments
  • nodejs Projects
  • Practice Questions
  • Productivity
  • Pygame Tutorial
  • Python Tutorial
  • Python-Assignments
  • Questions
  • Quiz
  • sql-functions
  • SQL-Tutorial
  • Tkinter Tutorial
  • Uncategorized
  • What Is
  • Why

Archives

  • June 2026
  • May 2026
  • April 2026
  • March 2026
  • February 2026
  • December 2025
  • November 2025
  • October 2025
  • September 2025
  • July 2025
  • April 2025
  • October 2024
  • September 2024
  • June 2024
  • April 2024
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • May 2022
  • November 2021
  • May 2021
  • March 2021
  • November 2020
  • October 2020
  • August 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • September 2019
  • August 2019
  • May 2019
  • March 2019
  • February 2019
  • January 2019
About CoderMantra

Coder Mantra is a unique e-learning website, offers a tutorial of different popular programming languages with examples. The code on this popular tutorial website is tested and executed.

Latest Posts
Draw Shapes and Colors in Pygame – Lesson 2 June 24, 2026
Pygame Tutorial for Kids – Lesson 1 June 23, 2026
25 Most Asked Java Interview Programs with Output (For Freshers) June 18, 2026
25 Java Pattern Programs with Output for Beginners June 10, 2026
Contact Us

info@codermantra.com

admin@codermantra.com

© 2020 Coder Mantra . All Rights Reserved
About | Privacy Policy | Terms | Contact