A form contains two fields named id1 and id2. How can you copy the value of the id2 field to id1?
document.forms[0].id1.value=document.forms[0].id2.value 92.0%
document.forms[0].id2.value=document.forms[0].id1.value 2.0%
document.id1.value=document.id2.value 0.0%
document.id2.value=document.id1.value 4.0%
An HTML form contains 10 checkboxes all named "chkItems". Which JavaScript function can be used for checking all the checkboxes together?
function CheckAll() { for (z = 0; z < document.forms.chkItems.length; z++) { document.forms.chkItems[z].checked=true } } 0.0%
function CheckAll() { for (z = 0; z < document.forms[0].chkItems.length; z++) { document.forms[0].chkItems[z].checked=true } } 89.0%
function CheckAll() { for (z = 0; z < document.forms[0].chkItems.length; z++) { document.forms[0].chkItems.list[z].checked=true } } 10.0%
function CheckAll() { for (z = 0; z < document.forms[0].chkItems.length; z++) { document.forms[0].chkItems.list[z].checked=false } } 0.0%
An image tag is defined as follows: <img id="ERImage" width="100" height="100" onmouseover="ImageChange()" src="Image1.jpg"> The purpose of the ImageChange() function is to change the image sour...
document.getElementById('ERImage').src="Image1.jpg" 0.0%
document.getElementById('ERImage').src="Image2.jpg" 97.0%
document.getElementById('ERImage').style.src="Image1.jpg" 1.0%
document.getElementById('ERImage').style.src="Image2.jpg" 0.0%
An image tag is defined as follows: <img id="ERImage" width="100" height="100" onmouseover="ImageChange()" src="Image1.jpg"> The purpose of the ImageChange() function is to change the image source...
document.getElementById('ERImage').src="Image1.jpg" 0.0%
document.getElementById('ERImage').src="Image2.jpg" 100.0%
document.getElementById('ERImage').style.src="Image1.jpg" 0.0%
document.getElementById('ERImage').style.src="Image2.jpg" 0.0%
Analyze the following code snippet which uses a Javascript Regular Expression character set. What will be the output of this code? <html> <body> <script type="text/javascript"> var str = "Is ...
I 12.0%
Is 0.0%
s 85.0%
I,s, 1.0%
Are the two statements below interchangeable? object.property object[''property'']
Consider the following image definition: <img id="logo" src="companylogo1.gif" height="12" width="12" > Which of the following will change the image to "companylogo2.gif" when the page loads?
logo.source="companylogo2.gif" 0.0%
logo.source="companylogo1.gif" 0.0%
document.getElementById('logo').src="companylogo1.gif" 0.0%
document.getElementById('logo').src="companylogo2.gif" 100.0%
Consider the following image definition: <img id="logo" src="companylogo1.gif" height="12" width="12" > Which of the following will change the image to companylogo2.gif when the page loads?
logo.source="companylogo2.gif" 0.0%
logo.source="companylogo1.gif" 0.0%
document.getElementById('logo').src="companylogo1.gif" 0.0%
document.getElementById('logo').src="companylogo2.gif" 100.0%
Consider the following JavaScript alert: <script type="text/JavaScript"> function message() { alert("Welcome to ExpertRating!!!") } </script> Which of the following will run the function when...
body onload="message()" 100.0%
body onunload="message()" 0.0%
body onsubmit="message()" 0.0%
body onreset="message()" 0.0%
Consider the following JavaScript alert: <script type="text/JavaScript"> function message() { alert("Welcome to ExpertRating!!!") } </script> Which of the following will run the function when a...
body onload="message()" 100.0%
body onunload="message()" 0.0%
body onsubmit="message()" 0.0%
body onreset="message()" 0.0%
Consider the following JavaScript validation function: <script type="text/JavaScript"> function ValidateField() { if(document.forms[0].txtId.value =="") {return false;} ...
input name=txtId type="text" onreset="return ValidateField()" 2.0%
input name=txtId type="text" onfocus="return ValidateField()" 1.0%
input name=txtId type="text" onsubmit="return ValidateField()" 0.0%
input name=txtId type="text" onblur="return ValidateField()" 96.0%
Consider the following JavaScript validation function: function ValidateField() { if(document.forms[0].txtId.value =="") {return false;} return true; } Which of the...
input name=txtId type="text" onreset="return ValidateField()" 0.0%
input name=txtId type="text" onfocus="return ValidateField()" 0.0%
input name=txtId type="text" onsubmit="return ValidateField()" 0.0%
input name=txtId type="text" onblur="return ValidateField()" 100.0%
Consider the following variable declarations: var a="adam" var b="eve" Which of the following would return the sentence "adam and eve"?
a.concatinate("and", b) 1.0%
a.concat("and", b) 0.0%
a.concatinate(" and ", b) 0.0%
a.concat(" and ", b) 98.0%
Consider the three variables: someText = 'JavaScript1.2'; pattern = /(w+)(d).(d)/i; outCome = pattern.exec(someText); What does outCome[0] contain?
true 1.0%
false 0.0%
JavaScript1.2 96.0%
null 1.0%
0 1.0%
Having an array object var arr = new Array(), what is the best way to add a new item to the end of an array?
arr.push("New Item") 100.0%
arr[arr.length] = "New Item" 0.0%
arr.unshift("New Item") 0.0%
arr.append("New Item") 0.0%
How can a JavaScript object be printed?
console.log(obj) 100.0%
console.print(obj) 0.0%
console.echo(obj); 0.0%
None of these 0.0%
How can created cookies be deleted using JavaScript?
They can't be deleted. They are valid until they expire. 0.0%
Overwrite with an expiry date in the past 100.0%
Use escape() on the value of the path attribute 0.0%
Use unescape() on the value of the path attribute 0.0%
The cookie file will have to be removed from the client machine. 0.0%
Wait till the expiry date is reached 0.0%
How can global variables be declared in JavaScript?
All variables are local in JavaScript. 0.0%
Declare the variable between the 'script' tags, and outside a function to make the variable global 100.0%
Precede the variable name with the constant global 0.0%
Declare the variable in an external file 0.0%
How can the operating system of the client machine be detected?
It is not possible using JavaScript. 2.0%
Using the navigator object 97.0%
Using the window object 0.0%
Using the document object 0.0%
None of these. 0.0%
How can the user's previously navigated page be determined using JavaScript?
It is not possible in JavaScript. This can be done only through server-side scripting. 0.0%
Using the document.referrer property 37.0%
Using the window object 62.0%
None of these 0.0%
If an image is placed styled with z-index=-1 and a text paragraph is overlapped with it, which one will be displayed on top?
The paragraph. 97.0%
The image. 0.0%
It depends on other rules. 2.0%
In an HTML page, the form tag is defined as follows: <form onsubmit="return Validate()" action="http://www.mysite.com/"> The validate() function is intended to prevent the form from being submitted...
<script type="text/javascript"> function Validate() { if(document.forms[0].name.value == "") return true; else return false; } </script> 0.0%
<script type="text/javascript"> function Validate() { if(document.forms[0].name.value == "") return false; else return true; } </script> 100.0%
script type="text/javascript"> function Validate() { if(document.forms[0].name== "") return false; else return true; } </script> 0.0%
<script type="text/javascript"> function Validate() { if(document.forms[0].name == "") return true; else return false; } </script> 0.0%
Performance-wise, which is the fastest way of repeating a string in JavaScript?
String.prototype.repeat = function( num ) { return new Array( num + 1 ).join( this ); } 3.0%
function repeat(pattern, count) { if (count < 1) return ''; var result = ''; while (count > 0) { if (count & 1) result += pattern; count >>= 1, pattern += pattern; } return result; } 6.0%
String.prototype.repeat = function(count) { if (count < 1) return ''; var result = '', pattern = this.valueOf(); while (count > 0) { if (count & 1) result += pattern; count >>= 1, pattern += pattern; } return result; }; 90.0%
String.prototype.repeat = function (n, d) { return --n ? this + (d || '') + this.repeat(n, d) : '' + this }; 0.0%
Select the following function that shuffles an array?
function shuffle(array) { var tmp, current, top = array.length; if(top) while(--top) { current = Math.floor(Math.random() * (top + 1)); tmp = array[current]; array[current] = array[top]; array[top] = tmp; } return array; } 98.0%
function shuffle(array) { return array.sort(function(a,b) { return (a-b); }); } 1.0%
function shuffle(array) { var results = new Array(); var sorted_arr = array.sort(); for (var i = 0; i < array.length - 1; i++) { if (sorted_arr[i + 1] == sorted_arr[i]) { results.push(sorted_arr[i]); } } return results; } 0.0%
function shuffle(array) { for (var tmp, cur, top=array.length; top--;){ cur = (Math.random() * (top + 1)) << 0; tmp = array[cur]; array[cur] = array[top]; array[top] = tmp; } return array.sort(); } 0.0%
The following are the samples for getting a selected value in the from a dropdown list: <select id="ddlViewBy"> <option value="1">test1</option> <option value="2" selected="selected">test2</option...
var e = document.getElementById("ddlViewBy"); var strUser = e.options[e.selectedIndex].text; 0.0%
var e = document.getElementById("ddlViewBy"); var strUser = e.options[e.selectedIndex].value; 100.0%
var e = document.getElementByName("ddlViewBy"); var strUser = e.options[e.selectedIndex].text; 0.0%
var e = document.getElementByName("ddlViewBy"); var strUser = e.options[e.selectedIndex].value; 0.0%
var profits=2489.8237 Which of the following code(s) produces the following output? output : 2489.824
profits.toFixed(4) 0.0%
profits.toFixed(3) 100.0%
profits.formatDollar(3) 0.0%
profits.nuberFormat(3) 0.0%
What does the following JavaScript code do? contains(a, obj) { for (var i = 0; i < a.length; i++) { if (a[i] === obj) { return true; } } return false; }
It calculates an array's length. 0.0%
It compares 'a' and 'obj' in an array. 1.0%
The code will cause an error. 6.0%
It checks if an array contains 'obj'. 91.0%
What is the difference between call() and apply()?
The call() function accepts an argument list of a function, while the apply() function accepts a single array of arguments. 98.0%
The apply() function accepts an argument list of a function, while the call() function accepts a single array of arguments. 1.0%
The call() function accepts an object list of a function, while the apply() function accepts a single array of an object. 0.0%
What is the error in the statement: var charConvert = toCharCode('x');?
toCharCode() is a non-existent method. 98.0%
Nothing. The code will work fine. 0.0%
toCharCode only accepts numbers. 0.0%
toCharCode takes no arguments. 1.0%
What is the final value of the variable bar in the following code? var foo = 9; bar = 5; (function() { var foo = 2; bar= 1; }()) bar = bar + foo;
10 96.0%
14 3.0%
3 0.0%
7 0.0%
What is the meaning of obfuscation in JavaScript?
Obfuscation is a keyword in JavaScript. 0.0%
Making code unreadable using advanced algorithms. 98.0%
Decrypting encrypted source code using advanced algorithms. 1.0%
None of these. 0.0%
What is the purpose of while(1) in the following JSON response? while(1);[['u',[['smsSentFlag','false'],['hideInvitations','false'],['remindOnRespondedEventsOnly','true'],['hideInvitations_remindO...
It's invalid JSON code. 1.0%
It makes it difficult for a third-party to insert the JSON response into an HTML document with a <script> tag. 94.0%
It iterates the JSON response. 0.0%
It prevents the JSON response from getting executed. 3.0%
What value would JavaScript assign to an uninitialized variable?
NaN 0.0%
null 0.0%
undefined 100.0%
false 0.0%
What will be output of the following code? function testGenerator() { yield "first"; document.write("step1"); yield "second"; document.write("step2"); yield "third"; docu...
firststep1second 94.0%
step1step2 0.0%
step1 3.0%
step1step2step3 1.0%
What will be the final value of the variable "apt"? var apt=2; apt=apt<<2;
2 0.0%
4 0.0%
6 2.0%
8 97.0%
16 0.0%
What would be the use of the following code? function validate(field) { var valid=''ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz''; var ok=''yes''; var temp; for(var i=0;i...
It will force a user to enter only numeric values. 0.0%
It will force a user to enter only alphanumeric values. 0.0%
It will force a user to enter only English alphabet character values. 96.0%
None of these. 3.0%
What would be the value of 'ind' after execution of the following code? var msg="Welcome to ExpertRating" var ind= msg.substr(3, 3)
lco 0.0%
com 100.0%
ome 0.0%
Welcome 0.0%
When setting cookies with JavaScript, what will happen to the cookies.txt data if the file exceeds the maximum size?
The script automatically generates a run-time error. 0.0%
The script automatically generates a load-time error. 0.0%
All processes using document.cookie are ignored. 0.0%
The file is truncated to the maximum length. 100.0%
Which event can be used to validate the value in a field as soon as the user moves out of the field by pressing the tab key?
onblur 100.0%
onfocus 0.0%
lostfocus 0.0%
gotfocus 0.0%
None of these 0.0%
Which object can be used to ascertain the protocol of the current URL?
document 0.0%
window 0.0%
history 0.0%
browser 0.0%
form 0.0%
location 100.0%
Which of following uses the "with" statement in JavaScript correctly?
with (document.getElementById("blah").style) { background = "black"; color = "blue"; border = "1px solid green"; } 98.0%
with document.getElementById("blah").style background = "black"; color = "blue"; border = "1px solid green"; End With 0.0%
With document.getElementByName("blah").style background = "black"; color = "blue"; border = "1px solid green"; End With 0.0%
with (document.getElementById("blah").style) { .background = "black"; .color = "blue"; .border = "1px solid green"; } 1.0%
Which of the following are correct values of variableC, and why? <script> variableA = [6,8]; variableB =[7,9]; variableC = variableA + variableB; </script>
6, 7, 8 and 9. The + operator is defined for arrays, and it concatenates strings, so it converts the arrays to strings. 0.0%
6, 15 and 9. The + operator is defined for arrays, and it concatenates numbers, so it converts the arrays to numbers. 0.0%
6, 8, 7 and 9. The + operator is defined for arrays, and it concatenates strings, so it converts the arrays to strings. 0.0%
6, 87 and 9. The + operator is not defined for arrays, and it concatenates strings, so it converts the arrays to strings. 100.0%
Which of the following are JavaScript unit testing tools?
Buster.js, jQuery, YUI Yeti 0.0%
QUnit, Modernizr, JsTestDriver 0.0%
Node.js, Modernizr, Jasmine 0.0%
Buster.js, YUI Yeti, Jasmine 100.0%
Which of the following are not global methods and properties in E4X?
ignoreComments 0.0%
ignoreWhiteSpace 0.0%
setName() 0.0%
setNamespace() 0.0%
ignoreComments and ignoreWhiteSpace 0.0%
setName() and setNamespace() 100.0%
Which of the following Array methods in JavaScript runs a function on every item in the Array and collects the result from previous calls, but in reverse?
reduce() 6.0%
reduceRight() 93.0%
reverse() 0.0%
pop() 0.0%
Which of the following best describes a "for" loop?
"for" loop consists of six optional expressions, enclosed in parentheses and separated by semicolons, followed by a statement executed in the loop. 0.0%
"for" loop consists of five optional expressions, enclosed in parentheses and separated by semicolons, followed by a statement executed in the loop. 0.0%
"for" loop consists of four optional expressions, enclosed in parentheses and separated by semicolons, followed by a statement executed in the loop. 0.0%
"for" loop consists of three optional expressions, enclosed in parentheses and separated by semicolons, followed by a statement executed in the loop. 100.0%
Which of the following built-in functions is used to access form elements using their IDs?
getItem(id) 0.0%
getFormElement(id) 0.0%
getElementById(id) 100.0%
All of these 0.0%
Which of the following can be used for disabling the right click event in Internet Explorer?
event.button == 2 100.0%
event.button == 4 0.0%
event.click == 2 0.0%
event.click == 4 0.0%
Which of the following can be used to escape the ' character?
* 0.0%
100.0%
- 0.0%
@ 0.0%
# 0.0%
% 0.0%
| 0.0%
~ 0.0%
Which of the following can be used to invoke an iframe from a parent page?
window.frames 100.0%
document.getElementById 0.0%
document.getelementsbyname 0.0%
document.getelementsbyclassname 0.0%
Which of the following choices will change the source of the image to "image2.gif" when a user clicks on the image?
img id="imageID" src="image1.gif" width="50" height="60" onmousedown="changeimg(image1.gif)" onmouseup="changeimg(image2.gif)" 87.0%
img id="imageID" src="image1.gif" width="50" height="60" onmouseclick="changeimg(image2.gif)" onmouseup="changeimg(image1.gif)" 1.0%
img id="imageID" src="image2.gif" width="50" height="60" onmousedown="changeimg(image1.gif)" onmouseup="changeimg(image2.gif)" 0.0%
img id="imageID" src="image2.gif" width="50" height="60" onmousedown="changeimg(image2.gif)" onmouseup="changeimg(image1.gif)" 0.0%
img id="imageID" src="image1.gif" width="50" height="60" onmousedown="changeimg('image2.gif')" onmouseup="changeimg('image1.gif')" 10.0%
Which of the following choices will detect if "variableName" declares a function? <script> var variableName= function(){}; </script>
return variableName; 0.0%
nameof variableName; 0.0%
isFunction variableName; 0.0%
typeof variableName; 100.0%
Which of the following choices will turn a string into a JavaScript function call (case with objects) of the following code snippet? <script> window.foo = { bar: { baz: function() { ...
bar['baz'](); 0.0%
object['foo']['bar']['baz'](); 0.0%
document['foo']['bar']['baz'](); 0.0%
window['foo']['bar']['baz'](); 100.0%
Which of the following code snippets changes an image on the page?
var img = document.getElementById("imageId"); img.src = "newImage.gif"; 96.0%
var img = document.getElementById("imageId"); img.style.src = "newImage.gif"; 3.0%
var img = document.getElementById("imageId"); img.src.value = "newImage.gif"; 0.0%
var img = document.getElementById("imageId"); img = "newImage.gif"; 0.0%
Which of the following code snippets gets an image's dimensions (height & width) correctly?
var img = document.getElementById('imageid'); var width = img.clientWidth; var height = img.clientHeight; 97.0%
var img = document.getElementById('imageid'); var width = img.width; var height = img.height; 2.0%
var img = document.getElementById('imageid'); var width = img.getAttribute('width'); var height = img.getAttribute('height'); 0.0%
var img=document.getElementById("imageid"); var width=img.offsetWidth; var height=img.offsetHeight; 0.0%
Which of the following code snippets is more efficient, and why? <script language="JavaScript"> for(i=0;i<document.images.length;i++) document.images[i].src="blank.gif"; </...
Both are equally efficient. 0.0%
The first code is more efficient as it contains less code. 0.0%
The first code is more efficient as it employs object caching. 0.0%
The second code is more efficient as it employs object caching. 100.0%
Which of the following code snippets removes objects from an associative array?
delete array["propertyName"]; 100.0%
array.propertyName.remove(); 0.0%
array.splice(index, 1); 0.0%
array["propertyName"].remove(); 0.0%
Which of the following code snippets returns "[object object]"?
<script> var o = new Object(); o.toSource(); </script> 0.0%
<script> var o = new Object(); o.valueOf(); </script> 2.0%
<script> var o = new Object(); o.toString(); </script> 97.0%
<script> var o = new Object(); o.getName(); </script> 0.0%
Which of the following code snippets trims whitespace from the beginning and end of the given string str?
str.replace(/^s+|s+$/g, ''); 100.0%
str.replace(/^s+/,''); 0.0%
str.replace(/s+$/,''); 0.0%
str.replace(/s+/g,' '); 0.0%
Which of the following code snippets will correctly get the length of an object?
<script> var newObj = new Object(); newObj["firstname"] = "FirstName"; newObj["lastname"] = "LastName"; newObj["age"] = 21; Object.size = function(obj) { var size = 0, key; for (key in obj) { if (obj.hasOwnProperty(index)) size++; } return size; }; var size = Object.size(newObj); </script> 0.0%
<script> var newObj = new Object(); newObj["firstname"] = "FirstName"; newObj["lastname"] = "LastName"; newObj["age"] = 21; Object.size = function(obj) { var size = 0, key; for (key in obj) { if (obj.hasOwnProperty(value)) size++; } return size; }; var size = Object.size(newObj); </script> 0.0%
<script> var newObj = new Object(); newObj["firstname"] = "FirstName"; newObj["lastname"] = "LastName"; newObj["age"] = 21; Object.size = function(obj) { var size = 0, key; for (key in obj) { if (obj.hasOwnProperty(length)) size++; } return size; }; var size = Object.size(newObj); </script> 0.0%
<script> var newObj = new Object(); newObj["firstname"] = "FirstName"; newObj["lastname"] = "LastName"; newObj["age"] = 21; Object.size = function(obj) { var size = 0, key; for (key in obj) { if (obj.hasOwnProperty(key)) size++; } return size; }; var size = Object.size(newObj); </script> 100.0%
Which of the following code snippets will correctly split "str"?
<script> var str = 'something -- something_else'; var substrn = str.split(' -- '); </script> 100.0%
<script> var str = 'something -- something_else'; var substrn = split.str(' --- '); </script> 0.0%
<script> var str = 'something -- something_else'; var substrn = str.split(' - ',' - '); </script> 0.0%
<script> var str = 'something -- something_else'; var substrn = split.str(' - ',' - '); </script> 0.0%
Which of the following code snippets will return all HTTP headers?
var req = new XMLHttpRequest(); req.open('GET', document.location, false); req.send(null); var headers = req.getAllResponseHeaders().toLowerCase(); alert(headers); 100.0%
var req = new XMLHttpAccess(); req.open('GET', document.location, false); req.send(null); var headers = req.getAllResponseHeaders().toLowerCase(); alert(headers); 0.0%
var req = new XMLHttpRequest(); req.open('GET', document.location, false); req.send(null); var headers = req.getResponseHeader().toLowerCase(); alert(headers); 0.0%
var req = new XMLHttpRequestHeader(); req.open('GET', document.location, false); req.send(null); var headers = req.retrieveAllResponseHeaders().toLowerCase(); alert(headers); 0.0%
Which of the following code snippets will toggle a div element's background color? <button id="toggle">Toggle</button> <div id="terd">Change Background Color.</div>
<script> var button = document.getElementById('toggle'); button.click = function() { terd.style.backgroundColor = terd.style.backgroundColor == 'blue' ? 'red' : 'blue'; }; </script> 0.0%
<script> var button = document.getElementById('toggle'); button.ready = function() { terd.style.backgroundColor = terd.style.backgroundColor == 'blue' ? 'red' : 'blue'; }; </script> 0.0%
<script> var button = document.getElementById('toggle'); button.focus = function() { terd.style.backgroundColor = terd.style.backgroundColor == 'blue' ? 'red' : 'blue'; }; </script> 0.0%
<script> var button = document.getElementById('toggle'); button.onclick = function() { terd.style.backgroundColor = terd.style.backgroundColor == 'blue' ? 'red' : 'blue'; }; </script> 100.0%
Which of the following correctly sets a class for an element?
document.getElementById(elementId).className = "Someclass"; 41.0%
document.getElementById(elementId).setAttribute("className", "Someclass"); 58.0%
document.getElementById(elementId).class = "Someclass"; 0.0%
document.getElementById(elementId).style = "Someclass"; 0.0%
Which of the following correctly uses a timer with a function named rearrange()?
tmr=setTimeout("rearrange ()",1) 100.0%
tmr=Timer(1,"rearrange ()") 0.0%
tmr=Timer("rearrange ()",1) 0.0%
tmr=setTimeout(1,"rearrange ()") 0.0%
Which of the following descriptions best describes the code below? <script> var variable1 = { fastFood: "spaghetti", length: 10 }; Object.freeze(variable1); variable1.price = 50; delete variable1....
Object is frozen, a property named "price" is added in the variable1 object, a property named "length" is deleted from this object. At the end of the code, the object "variable1" contains 2 properties. 0.0%
Object is frozen, a property named "price" is not added in the variable1 object, a property named "length" is deleted from this object. At the end of the code, object "variable1" contains 1 properties. 0.0%
Object is frozen, a property named "price" is added in the variable1 object, a property named "length" is not deleted from this object. At the end of the code, object "variable1" contains 1 properties. 2.0%
Object is frozen, a property named "price" is not added in the variable1 object, a property named "length" is not deleted from this object. At the end of the code, object "variable1" contains 2 properties. 97.0%
Which of the following descriptions is true for the code below? var object0 = {}; Object.defineProperty(object0, "prop0", { value : 1, enumerable:false, configurable : true }); Object.defineProper...
Object 'object0' contains 4 properties. Property 'prop2' and property 'prop3' are available in the for...in loop. Property 'prop0' and property 'prop1' are available to delete. 0.0%
Object 'object0' contains 4 properties. Property 'prop1' and property 'prop2' are available in the for...in loop. Property 'prop2' and property 'prop3' are available to delete. 0.0%
Object 'object0' contains 4 properties. Property 'prop0' and property 'prop2' are available in the for...in loop. Property 'prop0' and property 'prop2' are available to delete. 0.0%
Object 'object0' contains 4 properties. Property 'prop1' and property 'prop3' are available in the for...in loop. Property 'prop0' and property 'prop3' are available to delete. 100.0%
Which of the following determines whether cookies are enabled in a browser or not?
(navigator.Cookie)? true : false 0.0%
(application.cookieEnabled)? true : false 0.0%
(navigator.cookieEnabled)? true : false 100.0%
(application.cookie)? true : false 0.0%
Which of the following is not a valid HTML event?
ondblclick 0.0%
onmousemove 0.0%
onclick 0.0%
onblink 100.0%
Which of the following is not a valid JavaScript operator?
| 0.0%
=== 2.0%
%= 9.0%
^ 88.0%
Which of the following is not a valid method for looping an array?
var a= [1,2]; for (var i = 0; i < a.length; i++) { alert(a[i]); } 0.0%
var a= [1,2]; a.forEach( function(item) { alert(item); }) 0.0%
var a= [1,2]; a.map( function(item) { alert(item); }) 0.0%
var a= [1,2]; a.loop( function(item) { alert(item); }) 100.0%
Which of the following is not a valid method in generator-iterator objects in JavaScript?
send() 2.0%
throw() 0.0%
next() 0.0%
stop() 97.0%
Which of the following is the correct syntax for using the JavaScript exec() object method?
RegExpObject.exec() 0.0%
RegExpObject.exec(string) 92.0%
RegExpObject.exec(parameter1,parameter2) 0.0%
None of these 7.0%
Which of the following is the most secure and efficient way of declaring an array?
var a = [] 100.0%
var a = new Array() 0.0%
var a = new Array(n) 0.0%
var a 0.0%
Which of the following is true about setTimeOut()?
The statement(s) it executes run(s) only once. 97.0%
It pauses the script in which it is called. 0.0%
clearTimeOut() won't stop its execution. 0.0%
The delay is measured in hundredths of a second. 2.0%
It is required in every JavaScript function. 0.0%
Which of the following JavaScript Regular Expression modifiers finds one or more occurrences of a specific character in a string?
? 2.0%
* 6.0%
+ 91.0%
# 0.0%
Which of the following methods will copy data to the Clipboard?
execClipboard('Copy') 2.0%
copyCommand('Clipboard') 0.0%
execCommand('Copy') 97.0%
execClipboard('Copy') 0.0%
Which of the following modifiers must be set if the JavaScript lastIndex object property was used during pattern matching?
i 0.0%
m 0.0%
g 100.0%
s 0.0%
Which of the following objects in JavaScript contains the collection called "plugins"?
Location 0.0%
Window 0.0%
Screen 0.0%
Navigator 100.0%
Which of the following options can be used for adding direct support for XML to JavaScript?
E4X 100.0%
egex 0.0%
Generators and Iterators 0.0%
let 0.0%
Which of the following prints "AbBc"?
var b = 'a'; var result = b.toUpperCase() + 'b' + 'b'.toUpperCase() +'C'['toLowerCase'](); alert(result); 100.0%
var b = 'a'; var result = b.toUpperCase() + 'b' + 'b'.toUpperCase() +'c'['toUpperCase'](); alert(result); 0.0%
var b = 'a'; var result = b.toUpperCase() + b + 'b'.toUpperCase() +'C'['toLowerCase'](); alert(result); 0.0%
var b = 'a'; var result = b.toUpperCase() + 'b' + 'b'.toUpperCase() +C; alert(result); 0.0%
Which of the following Regular Expression pattern flags is not valid?
gi 0.0%
p 100.0%
i 0.0%
g 0.0%
Which of the following results is returned by the JavaScript operator "typeof" for the keyword "null"?
function 0.0%
object 100.0%
string 0.0%
number 0.0%
Which of the following statements is correct?
There is no undefined property in JavaScript. 0.0%
Undefined object properties can be checked using the following code: if (typeof something == null) alert("something is undefined"); 0.0%
It is not possible to check for undefined object properties in JavaScript. 0.0%
Undefined object properties can be checked using the following code: if (typeof something === "undefined") alert("something is undefined"); 100.0%
Which of the following will change the color of a paragraph's text to blue when a user hovers over it, and reset it back to black when the user hovers out?
<p onmouseover="style.color='black'" onmouseout="style.color='blue'"> The text of the paragraph..</p> 0.0%
<p onmouseover="style.color='blue'" onmouseout="style.color='black'"> The text of the paragraph..</p> 97.0%
<p onmouseout="style.color='blue'"> The text of the paragraph..</p> 0.0%
<p onmouseover="style.color='blue'"> The text of the paragraph..</p> 0.0%
<p onmousein="style.color='blue'" onmouseout="style.color='black'"> The text of the paragraph..</p> 2.0%
Which of the following will check whether the variable vRast exists or not?
if (typeof vRast="undefined") {} 0.0%
if (typeof vRast =="undefined") {} 100.0%
if (vRast.defined =true) {} 0.0%
if (vRast.defined ==true) {} 0.0%
Which of the following will detect which DOM element has the focus?
document.activeElement 100.0%
document.ready 0.0%
document.referrer 0.0%
document.getelementbyid 0.0%
Which of the following will randomly choose an element from an array named myStuff, given that the number of elements changes dynamically?
randomElement = myStuff[Math.floor(Math.random() * myStuff.length)]; 95.0%
randomElement = myStuff[Math.ceil(Math.random() * myStuff.length)]; 4.0%
randomElement = myStuff[Math.random(myStuff.length)]; 0.0%
randomElement = Math.random(myStuff.length); 0.0%