Logo

Javascript Questions Set 10:

Quiz Mode

How can we generate random numbers in JavaScript?

1
2
3
4

Solution:

Which option provides the most efficient file size reduction?

1
2
3
4

Solution:

The error displayed if p is not defined in the following statement: 

console.log(p) 

1
2
3
4

Solution:

Which methods are used to associate further action with a promise that becomes settled?

1
2
3
4

Solution:

 

What will be the output of the following JavaScript code?



  string  a = ”hi”; 

  string  b =”there”; 

  alert(a+b); 

1
2
3
4

Solution:

What will be the output of the following code snippet?

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

1
2
3
4

Solution:

Which of the following statements about the useContext hook is correct?

1
2
3
4

Solution:

When will the fourth argument to open() be useful?

1
2
3
4

Solution:

 What will be the output of the following JavaScript code? 


 

<p id="demo"></p>
<script>
var numbers = [45, 4, 9, 16, 25];
var arr= numbers.every(myFunction);
document.getElementById("demo").innerHTML =arr;
function myFunction(value, index, array)
{
  return value > 18;
}
</script>

1
2
3
4

Solution:

Which script should be added to use AngularJS directly from a CDN in an HTML document?

1
2
3
4

Solution: