CoderMantra

Menu
  • Home
  • Quiz
  • How-To
  • Q/A
  • Blog

javascript-exam

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

JavaScript Questions

1 / 15

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

// Javascript code to compare the height
function height()
{ 
    var  height = 123.56;
    var type = (height>=190) ? "tall" : "short";
    return type;
}

2 / 15

2. Which of the following function of the String object returns the character in the string starting at the specified position via the specified number of characters?

3 / 15

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

4 / 15

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

var a = 1;  
var b = 0;  
while (a <= 3)  
{  
   a++;  
   b += a * 2;  
   print(b);
}

5 / 15

5.  What will be the function of the following JavaScript program?

var scope = "js scope";
function checkscope() 
{
    var scope = "javascript scope"; 
    function f() 
    { 
         return scope; 
    }
    return f;
}

6 / 15

6. Which JavaScript method is used to write HTML output?

7 / 15

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

a = [1, 2, 3, 4, 5];
print(a.slice(2, 4));

8 / 15

8. When an operator’s value is NULL, the typeof returned by the unary operator is:

9 / 15

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

var quiz=[1,2,3];
var js=[6,7,8];
var result=quiz.concat(js);
document.writeln(result);

10 / 15

10.

Which one of the following is correct output for the following given JavaScript code if there is a p tag with id=demo ?
functionourFunction()
{
document.getElementById("demo").innerHTML=Math.abs(-7.25);
}

11 / 15

11. Which function is used to serialize an object into a JSON string in Javascript?

12 / 15

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

var a = "hello";
var sum = 0;
for(var i = 0; i < a.length; i++) {
   sum += (a[i] - 'a');
}
print(sum);

13 / 15

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

14 / 15

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

(function(a){
 return (function(){
   console.log(a);
   a = 6;
 })()
})(21);

15 / 15

15. Which function is used to clear the timer value?

Your score is

LinkedIn Facebook Twitter VKontakte
0%

Category

  • Assignments
    • C Language Assignments
    • C++ Assignments
  • C Programming
  • c-plus-plus-Assignments
  • Core Java
  • How To
  • Java-Assignments
  • node js questions
  • nodejs assignments
  • nodejs Projects
  • Practice Questions
  • Python Tutorial
  • Python-Assignments
  • Questions
  • Quiz
  • Tkinter Tutorial
  • Uncategorized
  • What Is

Archives

  • 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
How to upload a file using Node js.? May 26, 2023
How to Create http module to transfer data over the Hyper Text Transfer Protocol? May 26, 2023
How to Create steps for forgot password link in node js ? May 26, 2023
How to send e-mail using node js? May 26, 2023
Contact Us

info@codermantra.com

admin@codermantra.com

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