JavaScript Questions


Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-content/plugins/quiz-maker/public/class-quiz-maker-public.php on line 1335

Deprecated: Implicit conversion from float 0.16666666666666666 to int loses precision in /home/u797631661/domains/codermantra.com/public_html/wp-content/plugins/quiz-maker/includes/class-quiz-maker-data.php on line 1008

Deprecated: Implicit conversion from float 0.16666666666666666 to int loses precision in /home/u797631661/domains/codermantra.com/public_html/wp-content/plugins/quiz-maker/includes/class-quiz-maker-data.php on line 1008

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/u797631661/domains/codermantra.com/public_html/wp-includes/formatting.php on line 449
0 votes, 0 avg
509

JavaScript Questions

1 / 15

1. Which of the following is the language of javascript?

2 / 15

2. Arrays in JavaScript are defined by which of the following statements?

3 / 15

3. JavaScript code can be written in ____.

4 / 15

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


var a = "Scaler";
var result = a.substring(2, 4);
document.write(result);

5 / 15

5. 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);

6 / 15

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

7 / 15

7. 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;
}

8 / 15

8.  Which is the function that calls another function after a time interval?

9 / 15

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

function solve(arr, rotations){
 if(rotations == 0) return arr;
 for(let i = 0; i < rotations; i++){
   let element = arr.pop();
   arr.unshift(element);
 }
 return arr;
}
// solve([44, 1, 22, 111], 5);

10 / 15

10.  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;
}

11 / 15

11. The process in which an object or data structure is translated into a format suitable for transferral over a network, or storage is called?

12 / 15

12. Which object serves as the global object at the top of the scope chain?

13 / 15

13. What does the ‘toLocateString()’ method do in JS?

14 / 15

14. Arrays in JavaScript are defined by which of the following statements?

15 / 15

15. Among the given statements, which statement defines closures in JavaScript?