Logo

Javascript Questions Set 43:

Quiz Mode

How many standard WebSocket events are available?

1
2
3
4

Solution:

How do we create and preload an image object in JavaScript?

1
2
3
4

Solution:

When will the window property come into play?

1
2
3
4

Solution:

What is the purpose of form control elements in the HTML DOM?

1
2
3
4

Solution:

What will be the output of the following code?

const module = {

  x: 42,

  getX: function() {

    return this.x;

  }

}

const unboundGetX = module.getX;

console.log(unboundGetX());

1
2
3
4

Solution:

What does it indicate when the type attribute of the navigation object is set to 2?

1
2
3
4

Solution:

Which of the following statements about AJAX is false?

1
2
3
4

Solution:

What is the output of the following code?

const array1 = [100, 's', new Date('18 jan 2020 14:12:00 UTC')];

const locString = array1.toLocaleString('en', {timeZone: "UTC"});

console.log(locString);

1
2
3
4

Solution:

What will be the output of the following JavaScript code?

var scope = "global scope";

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


1
2
3
4

Solution:

 

function chemistryelement()  
{  
   var chem=document.getElementsByName("elements");  
   alert("Total Elements:"+chem.length);  
}  
<form>  
    <input type="radio" name="elements" value="Sulphur">  
    <input type="radio" name="elements" value="Oxygen">

     <input type="radio" name="elements" value="Neon">  
    <input type="button" onclick="chemistryelement()" value="Total Elements">  
</form>

1
2
3
4

Solution: