Logo

Javascript Questions Set 99:

Quiz Mode

Is the following JavaScript script valid?

1
2

Solution:

Advantages of Flux are:

1
2
3
4

Solution:

Which method of the Location object makes the window load and display the document at the URL specified?

1
2
3
4

Solution:

Which React hook accepts a context object and returns the current context value for that context?

1
2
3
4

Solution:

Find the output of the following code:


<script>

var x = 83;

var y = "false";

document.write(83 * Number(y));

</script>

1
2
3
4

Solution:

What is Microsoft's proprietary client-side storage mechanism in Internet Explorer?

1
2
3
4

Solution:

Which method is used to apply the accordion widget on the HTML element?

1
2
3
4

Solution:

Which two functions are not allowed in any secure JavaScript subset?

1
2
3
4

Solution:

Predict the output:


function sum() {
 return this.a + this.b + this.c;
}

var o = {
 a: 1,
 b: 2,
 c: 3,
 get average() {
   return (this.a + this.b + this.c) / 3;
 }
};

Object.defineProperty(o, 'sum', {
   get: sum, enumerable: true, configurable: true});

console.log(o.average, o.sum);

1
2
3
4

Solution:

Statement 1: getElementByClassName returns a collection of elements (as an array) in the document matching the specified class name.


Statement 2: getElementById and getElementsByTagName also operate in a similar manner.

1
2
3
4

Solution: