Logo

Javascript Questions Set 1:

Quiz Mode

Which property helps to initiate HTTP requests?

1
2
3
4

Solution:

Deduce the output of the following code:


<script>

document.write(typeof("3"*"4"))

</script>

Solution:

Why do we need a bubble chart?

1
2
3
4

Solution:

Which object is passed as the argument to handlers for keydown, keypress and keyup events?

1
2
3
4

Solution:

Which two functions are not allowed in any secure subset?

1
2
3
4

Solution:

When are mouse events generated?

1
2
3
4

Solution:

What is the output of the following code?


var materials = [
'Hydrogen',
'Helium',
'Lithium',
'Beryllium'
];

console.log(materials.map(material => material.length));

1
2
3
4

Solution:

Which of the following calculations is correct to determine the time taken for a page to load once it is received from the server?

1
2
3
4

Solution:

What will be the role of the continue keyword in the following JavaScript code snippet?

while (a != 0) {
if (a == 1) {
continue;
} else {
a++;
}
}

1
2
3
4

Solution:

What will be the output of the following code?

class formatDate extends Date {

  constructor(dateStr) {

    super(dateStr);

  }


  getFormattedDate() {

    const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',

                  'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];


    return `${this.getDate()}-${months[this.getMonth()]}-${this.getFullYear()}`;

  }

}


console.log(new formatDate('August 19, 1975 23:15:30').getFormattedDate());

1
2
3
4

Solution: