Upwork Test Answers: Get all the correct answers of most recent and possible Upwork Tests A to Z (Updated on Jan, 2016)
Cover Letter Templates: These cover letter samples are not only for Upwork job, but also you will have some idea about your real life job
 
Freelance Profile Overviews: Different Profile samples and overviews of experts, advanced and intermediate level freelancers
For Newbie of Upwork: Upwork Help - How to apply for a job in Upwork with 10 most important articles about Upwork

A to Z View - All Upwork Test Answers

E4X Test Answers (new)

This test answers is for Web Developers and it will be helping hand to get the related jobs in Upwork. Search your desired answers of the test question by pressing Ctrl + F button.

It is a Upwork's Database category test. Here you will have most recent Upwork test questions and correct answers of Upwork E4X Test.
--------------------------------------------------------------------------------------------------------------------------


1. Which of the following methods is not one of the global methods and properties in E4X?
 Answers: • isScopeNamespaces() or • removeNamespaces()

 2. Which of the following characters are treated as white space characters?
 Answers: • tab or • Line feed

 3. Which of the following is the correct syntax for calling the Namespace constructor as a function in E4X?
 Answers: • Namespace() or • Namespace(uriValue)

 4. Which of the following methods would give the output corresponding to the code snippet?

 var test =
 <type name="Joe">
 <base name="Bob"></base>
 example
 </type>;

 output:

 <type name="Joe">
 <base name="Bob"/>
 example
 </type>
 Answers: • alert(test.toXMLString()); or • alert(test.elements());

 5. What is the value returned when the input parameter type of the XMLList() function in E4x is Number?
 Answers: • The value is first converted to a string and then converted to an XMLList object.

 6. Consider the code snippet below. Which of the given options represents the correct sequence of outputs when this code is executed in E4X?

 var p1 = <p>Kibology for all.</p>;
 alert(p1.name().uri);
 default xml namespace = 'http://www.w3.org/1999/xhtml';
 var p2 = <p>Kibology for all.</p>;
 alert(p2.name().uri);
 default xml namespace = '';
 var p3 = <p>Kibology for all.</p>;
 alert(p3.name().uri);
 Answers: • '',http://www.w3.org/1999/xhtml,http://www.w3.org/1999/xhtml

 7. Consider the following code snippet. Which of the given options would be used in E4X to change the color of the descendant node chair?

 var element = <Home>
 <Room>
 <Furniture>
 <chair color="Brown"/>
 <Furniture>
 </Room>
 </Home>
 Answers: • element.chair.color="light brown"

 8. Which of the following public methods in E4X has the return type XML?
 Answers: • parent()

 9. Which of the following operators is used for inserting XML objects in the context of their parent in E4X?
 Answers: • +=

 10. What will be the output of the following code snippet?

 var xml = <body></body>;
 xml.appendChild("hello");
 Xml.appendChild(" world");
 xml.normalize();
 alert(xml.children().length());
 Answers: • 1

 11. Consider the code snippet below. Which of the given options represents the correct output of the code attribute substitution for special characters in E4X?

 var b = 'Best of luck "Studentname & Roll no" for your exam';
 var el = <foo a={b}/>;
 alert(el.toXMLString());
 Answers: • <foo a="Best of luck "Studentname & Roll no" for your exam"/>

 12. What is the default value of the property prettyIndent in E4X?
 Answers: • 1

 13. What will be the output of the following code snippet?

 element = <xhtml:p xmlns:xhtml="http://www.example.org">Kibology
 for all.</xhtml:p>;
 elementName = element.name();
 alert(elementName.localName); //1
 alert(elementName.uri); // 2
 Answers: • 1-p,2-http://www.example.org

 14. Which of the following is not a valid built-in method for XMLList objects in E4X?
 Answers: • hasOwnProperty(propertyName)

 15. Which of the following is not a reserved keyword in E4X and JavaScript?
 Answers: • super

 16. State whether true or false:

 An arbitrary xml file can be loaded as an E4X ready object.
 Answers: • True

 17. Which of the following settings are there in E4x to influence parsing and serialization?

 element = <xhtml:p xmlns:xhtml="http://www.example.org">Kibology
 for all.</xhtml:p>;
 elementName = element.name();
 alert(elementName.localName); //
 alert(elementName.uri); //
 Answers: • All of the above

 18. Which of the following options would be returned by the code shown in the code snippet:

 var f =
 <foo>
 <a>
 text
 </a>
 <a>
 <b/>
 </a>
 </foo>;
 alert(f.a[0].hasComplexContent());// p
 alert(f.a[1].hasComplexContent());//q
 alert(f.a[0].hasSimpleContent());//r
 alert(f.a[1].hasSimpleContent());//s
 Answers: • p-1,q-0,r-0,s-1

 19. Which of the following options can be used for adding direct support for XML to JavaScript?
 Answers: • let

 20. What will be the output of the following code snippet?

 var customer = <customer>
 <phone type="mobile">888-555-1212</phone>
 <phone type="office">888-555-2121</phone>
 <preferred>mobile</preferred>
 </customer>;
 alert(customer.childIndex());
 Answers: • 0

 21. Which of the following options is the correct alternative to the code snippet so as to get the given output?

 Code:

 var e= <employee>
 <name>Smith</name>
 <designation>S/w Engineer</designation>
 </employee>
 e.prependChild(<prefix>Mr.</prefix>);
 alert(e.toString());

 Output:

 <employee>
 <prefix>Mr.</prefix>
 <name>Smith</name>
 <designation>S/w Engineer</designation>
 </employee>
 Answers: • b.e.insertChildBefore(null,<prefix>Mr.</prefix>);

 22. Which of the following are not global methods and properties in E4X?
 Answers: • setNamespace()

 23. Which of the following is not true of the Namespace constructor in E4X?
 Answers: • If the value is a valid XML name, the prefix property is set to a string.

 24. Which of the following is the correct way to create an XML object in E4X?
 Answers: • var languages XML = new XML('<languages type="dynamic"><lang>JavaScript</lang><lang>Python</lang></languages>');

 25. State whether true or false:

 The QName.prototype.toString() method throws a TypeError exception if its value is not a QName object.
 Answers: • True

 26. Which of the following can be used to create attribute values by placing variables and expressions within them?
 Answers: • <>

 27. Which of the following options is used to access the attributes in E4X?
 Answers: • ::

 28. What is the correct way to add a method to an XML.prototype in E4X?
 Answers: • XML.prototype.method::[methodNameString]

 29. Which of the following options can be used to delete a child node of an XML object in E4X?
 Answers: • delete xmlobject.@attribute;

 30. Which of the given options represents the correct length when alert(Emp..*.length()); is applied to the following code?

 var Emp = <Emp>
 <name>Mark</name>
 <likes>
 <os>Linux</os>
 <browser>Firefox</browser>
 <language>JavaScript</language>
 <language>Python</language>
 </likes>
 </Emp>
 Answers: • 12