Java Script Framework Soln
Java Script Framework Soln
Contents
JAVA Script .................................................................................................................................................................................. 1
J Query ........................................................................................................................................................................................ 9
Node JS...................................................................................................................................................................................... 15
Angular JS 2 ............................................................................................................................................................................... 18
JAVA Script
Q1. Which of the following is correct about JavaScript?
a. JavaScript is a lightweight, interpreted programming language.
b. JavaScript has object-oriented capabilities that allows you to build interactivity into otherwise static HTML
pages.
c. The general-purpose core of the language has been embedded in Netscape, Internet Explorer, and other
web browsers.
d. All of the above.
Q7. Which of the following is true about variable naming conventions in JavaScript?
a. You should not use any of the JavaScript reserved keyword as variable name.
b. JavaScript variable names should not start with a numeral 0 − 9.
c. Both of the above. d. None of the above.
Q8. Which of the following is true about variable naming conventions in JavaScript?
1
Vidyanidhi Info Tech Academy
Vidyanidhi Info Tech Academy
PG DAC Question Bank
a. JavaScript variable names must begin with a letter or the underscore character.
b. JavaScript variable names are case sensitive.
c. Both of the above. d. None of the above.
Q12. Which of the following is the correct syntax to create a cookie using JavaScript?
a. document.cookie = 'key1 = value1; key2 = value2; expires = date';
b. browser.cookie = 'key1 = value1; key2 = value2; expires = date';
c. window.cookie = 'key1 = value1; key2 = value2; expires = date';
d. navigator.cookie = 'key1 = value1; key2 = value2; expires = date';
Q13. Which of the following is the correct syntax to redirect a url using JavaScript?
a. document.location='http://www.newlocation.com'; b. browser.location='http://www.newlocation.com';
c. navigator.location='http://www.newlocation.com'; d. window.location='http://www.newlocation.com';
Q14. Which of the following is the correct syntax to print a page using JavaScript?
a. window.print; b. browser.print; c. navigator.print; d. document.print;
Q15. Which of the following is a valid type of function java script supports?
a. named function b. anonymous function c. Both of the above. d. None of the above.
Q18. How can you get the type of arguments passed to a function?
a. using type of operator b. using get Type function c. Both of the above. d. None of the above.
Q19. How can you get the total number of arguments passed to a function?
a. Using args.length property b. Using arguments.length property
c. Both of the above. d. None of the above.
Q20. Which of the following type of variable is visible everywhere in your Java Script code?
a. global variable b. local variable c. Both of the above. d. None of the above.
Q21. Which of the following type of variable is visible only within a function where it is defined?
a. global variable b. local variable c. Both of the above. d. None of the above.
2
Vidyanidhi Info Tech Academy
Vidyanidhi Info Tech Academy
PG DAC Question Bank
Q22. Which of the following type of variable takes precedence over other if names are same?
a. global variable b. local variable c. Both of the above. d. None of the above.
Q24. Which built-in method returns the character at the specified index?
a. characterAt b. getCharAt c. charAt d. None of the above.
Q25. Which built-in method combines the text of two strings and returns a new string?
a. append b. concat c. attach d. None of the above.
Q26. Which built-in method calls a function for each element in the array?
a. while b. loop c. forEach d. None of the above.
Q27. Which built-in method returns the index within the calling String object of the first occurrence of the
specified value?
a. getIndex b. location c. indexOf d. None of the above.
Q29. Which built-in method removes the last element from an array and returns that element?
a. last b. get c. pop d. None of the above.
Q30. Which built-in method adds one or more elements to the end of an array and returns the new length of the
array?
a. last b. put c. push d. None of the above.
Q31. Which built-in method reverses the order of the elements of an array?
a. changeOrderorder b. reverse c. sortorder d. None of the above.
Q33. Which built-in method returns the characters in a string beginning at the specified location?
a. substr b. getSubstring c. slice d. None of the above.
Q34. Which built-in method returns the calling string value converted to lower case?
a. toLowerCase b. toLower c. changeCasecase d. None of the above.
Q35. Which built-in method returns the calling string value converted to upper case?
a. toUpperCase b. toUpper c. changeCasecase d. None of the above.
3
Vidyanidhi Info Tech Academy
Vidyanidhi Info Tech Academy
PG DAC Question Bank
Q36. Which built-in method returns the string representation of the number's value?
a. toValue b. toNumber c. toString d. None of the above.
Q37. All user-defined objects and built-in objects are descendants of an object called Object?
a. true b. false
Q39. Which of the following function of Number object forces a number to display in exponential notation?
a. toExponential b. toFixed c. toPrecision d. toLocaleString
Q40.Which of the following function of Number object formats a number with a specific number of digits to the
right of the decimal?
a. toExponential b. toFixed c. toPrecision d. toLocaleString
Q41. Which of the following function of Number object returns a string value version of the current number in a
format that may vary according to a browser's locale settings?
a. toExponential b. toFixed c. toLocaleString d. toString
Q42. Which of the following function of Number object defines how many total digits to display of a number?
a. toExponential b. toFixed c. toLocaleString d. toPrecision
Q43. Which of the following function of Number object returns a string value version of the current number?
a. toString b. toFixed c. toLocaleString d. toPrecision
Q44. Which of the following function of Number object returns the number's value?
a. toString b. valueOf c. toLocaleString d. toPrecision
Q45. Which of the following function of Boolean object returns a string containing the source of the Boolean
object?
a. toSource b. valueOf c. toString d. None of the above.
Q46. Which of the following function of Boolean object returns the primitive value of the Boolean object?
a. toSource b. valueOf c. toString d. None of the above.
Q47. Which of the following function of Boolean object returns a string of either 'true' or 'false' depending upon
the value of the object?
a. toSource b. valueOf c. toString d. None of the above.
Q48. Which of the following function of String object returns the character at the specified index?
a. charAt b. charCodeAt c. concat d. indexOf
Q49. Which of the following function of String object returns a number indicating the Unicode value of the
character at the given index?
a. charAt b. charCodeAt c. concat d. indexOf
Q50. Which of the following function of String object combines the text of two strings and returns a new string?
a. add b. merge c. concat d. append
4
Vidyanidhi Info Tech Academy
Vidyanidhi Info Tech Academy
PG DAC Question Bank
Q51. Which of the following function of String object returns the index within the calling String object of the first
occurrence of the specified value?
a. substr b. search c. lastIndexOf d. indexOf
Q52. Which of the following function of String object returns the index within the calling String object of the last
occurrence of the specified value?
a. lastIndexOf b. search c. substr d. indexOf
Q53. Which of the following function of String object returns a number indicating whether a reference string
comes before or after or is the same as the given string in sort order?
a. localeCompare b. search c. substr d. concat
Q54. Which of the following function of String object is used to match a regular expression against a string?
a. concat b. match c. search d. replace
Q55. Which of the following function of String object is used to find a match between a regular expression and a
string, and to replace the matched substring with a new substring?
a. concat b. match c. replace d. search
Q56. Which of the following function of String object executes the search for a match between a regular
expression and a specified string?
a. concat b. match c. replace d. search
Q57. Which of the following function of String object extracts a section of a string and returns a new string?
a. slice b. split c. replace d. search
Q58.Which of the following function of String object splits a String object into an array of strings by separating
the string into substrings?
a. slice b. split c. replace d. search
Q59. Which of the following function of String object returns the characters in a string beginning at the
specified location through the specified number of characters?
a. slice b. split c. substr d. search
Q60. Which of the following function of String obje string between two indexes into the string?
a. slice b. split c. substr d. substring
Q61. Which of the following function of String object returns the calling string value converted to lower case
while respecting the current locale?
a. toLocaleLowerCase b. toLowerCase c. toString d. substring
Q62. Which of the following function of String object returns the calling string value converted to lower case?
a. toLocaleLowerCase b. toLowerCase c. toString d. substring
Q63.Which of the following function of String object returns the calling string value converted to upper case
while respecting the current locale?
a. toLocaleUpperCase b. toUpperCase c. toString d. substring
Q64. Which of the following function of String object returns the calling string value converted to upper case?
a. toLocaleUpperCase b. toUpperCase c. toString d. substring
5
Vidyanidhi Info Tech Academy
Vidyanidhi Info Tech Academy
PG DAC Question Bank
Q65. Which of the following function of String object returns a string representing the specified object?
a. toLocaleUpperCase b. toUpperCase c. toString d. substring
Q66. Which of the following function of String object returns the primitive value of the specified object.
a. toLocaleUpperCase b. toUpperCase c. toString d. valueOf
Q67. Which of the following function of String object creates an HTML anchor that is used as a hypertext target?
a. anchor b. link c. blink d. big
Q68. Which of the following function of String object creates a string to be displayed in a big font as if it were in
a <big> tag?
a. anchor b. big c. blink d. italics
Q69. Which of the following function of String object creates a string to blink as if it were in a <blink> tag?
a. anchor b. big c. blink d. italics
Q70. Which of the following function of String object creates a string to be displayed as bold as if it were in a <b>
tag?
a. anchor b. big c. blink d. bold
Q71. Which of the following function of String object causes a string to be displayed in fixed-pitch font as if it
were in a <tt> tag?
a. fixed b. big c. blink d. bold
Q72. Which of the following function of String object causes a string to be displayed in the specified color as if it
were in a <font color='color'> tag?
a. fixed b. fontcolor c. blink d. bold
Q73. Which of the following function of String object causes a string to be displayed in the specified size as if it
were in a <font size = 'size'> tag?
a. fixed b. fontcolor c. fontsize d. bold
Q74. Which of the following function of String object causes a string to be italic, as if it were in an <i> tag?
a. fixed b. fontcolor c. fontsize d. italics
Q75. Which of the following function of String object creates an HTML hypertext link that requests another URL?
a. link b. sub c. sup d. small
Q76. Which of the following function of String object causes a string to be displayed in a small font, as if it were
in a <small> tag?
a. link b. small c. sup d. sub
Q77. Which of the following function of String object causes a string to be displayed as struck-out text, as if it
were in a <strike> tag?
a. sup b. small c. strike d. sub
Q78. Which of the following function of String object causes a string to be displayed as a subscript, as if it were
in a <sub> tag?
6
Vidyanidhi Info Tech Academy
Vidyanidhi Info Tech Academy
PG DAC Question Bank
a. sup b. small c. strike d. sub
Q79.Which of the following function of String object causes a string to be displayed as a superscript, as if it were
in a <sup> tag?
a. sup b. small c. strike d. sub
Q80. Which of the following function of Array object returns a new array comprised of this array joined with
other arrays and/or values?
a. concat b. pop c. push d. some
Q81. Which of the following function of Array object returns true if every element in this array satisfies the
provided testing function?
a. concat b. every c. push d. some
Q82. Which of the following function of Array object creates a new array with all of the elements of this array for
which the provided filtering function returns true?
a. concat b. every c. filter d. some
Q83. Which of the following function of Array object calls a function for each element in the array?
a. concat b. every c. filter d. forEach
Q84. Which of the following function of Array object returns the first least index of an element within the array
equal to the specified value, or -1 if none is found?
a. indexOf b. join c. lastIndexOf d. map
Q85. Which of the following function of Array object joins all elements of an array into a string?
a. concat b. join c. pop d. map
Q86. Which of the following function of Array object returns the last greatest index of an element within the
array equal to the specified value, or -1 if none is found?
a. indexOf b. join c. lastIndexOf d. map
Q87.Which of the following function of Array object creates a new array with the results of calling a provided
function on every element in this array?
a. push b. join c. pop d. map
Q88. Which of the following function of Array object removes the last element from an array and returns that
element?
a. pop b. push c. join d. map
Q89. Which of the following function of Array object adds one or more elements to the end of an array and
returns the new length of the array?
a. pop b. push c. join d. map
Q90. Which of the following function of Array object applies a function simultaneously against two values of the
array fromleft − to − right as to reduce it to a single value?
a. pop b. push c. reduce d. reduceRight
7
Vidyanidhi Info Tech Academy
Vidyanidhi Info Tech Academy
PG DAC Question Bank
Q91. Which of the following function of Array object applies a function simultaneously against two values of the
array fromright − to − left as to reduce it to a single value?
a. pop b. push c. reduce d. reduceRight
Q92. Which of the following function of Array object reverses the order of the elements of an array?
a. reverse b. push c. reduce d. reduceRight
Q93. Which of the following function of Array object removes the first element from an array and returns that
element?
a. reverse b. shift c. slice d. some
Q94. Which of the following function of Array object extracts a section of an array and returns a new array?
a. reverse b. shift c. slice d. some
Q95. Which of the following function of Array object returns true if at least one element in this array satisfies the
provided testing function?
a. reverse b. shift c. slice d. some
Q96. Which of the following function of Array object represents the source code of an object?
a. toSource b. splice c. toString d. unshift
Q97. Which of the following function of Array object sorts the elements of an array?
a. toSource b. sort c. toString d. unshift
Q98. Which of the following function of Array object adds and/or removes elements from an array?
a. toSource b. sort c. splice d. unshift
Q99. Which of the following function of Array object returns a string representing the array and its elements?
a. toSource b. sort c. splice d. toString
Q100. Which of the following function of Array object adds one or more elements to the front of an array and
returns the new length of the array?
a. unshift b. sort c. splice d. toString
8
Vidyanidhi Info Tech Academy
Vidyanidhi Info Tech Academy
PG DAC Question Bank
Q105. Which of the following function of Number object returns a string value version of the current number?
a. toString() b. toFixed() c. toLocaleString() d. toPrecision()
Q106. Which of the following function of String object is used to match a regular expression against a string?
a. concat() b. match() c. search() d. replace()
Q107. Which of the following function of String object returns a string representing the specified object?
a. toLocaleUpperCase() b. toUpperCase() c. toString() d. substring()
Q108. Which of the following function of String object causes a string to be displayed in the specified size as if it
were in a <font size = 'size'> tag?
a. fixed() b. fontcolor() c. fontsize() d. bold()
Q109. Which of the following function of Array object calls a function for each element in the array?
a. concat() b. every() c. filter() d. forEach()
Q110. Which of the following function of Array object adds and/or removes elements from an array?
a. toSource() b. sort() c. splice() d. unshift()
J Query
Q1. Which of the following is correct about jQuery selector?
a. A jQuery Selector is a function which makes use of expressions to find out matching elements from a DOM
based on the given criteria.
b. jQuery selectors are used to select one or more HTML elements using jQuery.
c. jQuery selectors start with the dollar sign and parentheses - $()
d. All of the above.
Q2. Which of the following jQuery selector selects elements with the given element tag-name?
a. $('tag-name') b. $('#tag-name') c. $('.tag-name') d. None of the above.
Q3. Which of the following jQuery selector selects element with the given element id some-id?
a. $('some-id') b. $('#some-id') c. $('.some-id') d. None of the above.
Q4. Which of the following jQuery selector select elements whose css class is someclass?
a. $('some-class') b. $('#some-class') c. $('.some-class') d. None of the above.
Q5. Which of the following jQuery selector selects all elements available in a DOM?
a. $('*') b. $('?') c. $('#') d. None of the above.
Q9. Which of the following jQuery method removes an attribute from each of the matched elements?
9
Vidyanidhi Info Tech Academy
Vidyanidhi Info Tech Academy
PG DAC Question Bank
a. deleteAttrname b. removeAttrname c. removeAttributename d. None of the above.
Q10. Which of the following jQuery method returns true if the specified class is present on at least one of the set
of matched elements?
a. hasCSSClassclass b. hasStyleClassclass c. hasClassclass d. None of the above.
Q11. Which of the following jQuery method remove all or the specified classes from the set of matched elements?
a. removeClassclass b. removeStyleClassclass c. removeCSSClassclass d. None of the above.
Q12.Which of the following jQuery method adds the specified class if it is not present, remove the specified class
if it is present?
a. toggleStyleClassclass b. toggleClassclass c. toggleCSSClassclass d. None of the above.
Q13. Which of the following jQuery method gets the html contents innerHTML of the first matched element?
a. html b. getHtml c. getInnerHtml d. None of the above.
Q14. Which of the following jQuery method sets the html contents of an element?
a. htmlval b. setHtmlval c. setInnerHtmlval d. None of the above.
Q15. Which of the following jQuery method get the text contents of an element?
a. text b. getText c. getContent d. None of the above.
Q16. Which of the following jQuery method sets the text of an element?
a. textval b. setTextval c. setContentval d. None of the above.
Q17. Which of the following jQuery method get the input value of an element?
a. getContent b. val c. getValue d. None of the above.
Q18. Which of the following jQuery method set the value of an element?
a. setContentval b. valval c. setValueval d. None of the above.
Q19. Which of the following jQuery method filter out elements from a set of matched elements?
a. filterselector b. setFilterselector c. putFilterselector d. None of the above.
Q20. Which of the following jQuery method reduce the set of matched elements to a single element?
a. isEqualindex b. eqindex c. checkEqualselector d. None of the above.
Q21. Which of the following jQuery method checks the current selection against an expression?
a. getIsselector b. isselector c. checkIsselector d. None of the above.
Q22. Which of the following jQuery method removes elements matching the specified selector from the set of
matched elements?
a. getNotEqualsselector b. isNotEqualsselector c. notselector d. None of the above.
Q23. Which of the following jQuery method selects a subset of the matchedelements?
a. subsetselector b. getSubsetselector c. sliceselector d. None of the above.
Q24. Which of the following jQuery method adds more elements, matched by the given selector, to the set of
matched elements?
a. addselector b. addElementselector c. appendselector d. None of the above.
10
Vidyanidhi Info Tech Academy
Vidyanidhi Info Tech Academy
PG DAC Question Bank
Q25. Which of the following jQuery method adds the previous selection to the current selection?
a. addselector b. andSelf c. appendselector d. None of the above.
Q26. Which of the following jQuery method gets a set of elements containing all of the unique immediate
children of each of the matched set of elements?
a. getChildselector b. children[selector] c. getChildrenselector d. None of the above.
Q27. Which of the following jQuery method gets a set of elements containing the closest parent element that
matches the specified selector, the starting element included?
a. getNearestselector b. getClosest[selector] c. closestselector d. None of the above.
Q28. Which of the following jQuery method finds all the child nodes inside the matched elements
includingtextnodes, or the content document, if the element is an iframe?
a. getChildrenselector b. getContents[selector] c. contentsselector d. None of the above.
Q29. Which of the following jQuery method reverts the most recent 'destructive'operation, changing the set of
matched elements to its previous state?
a. revert b. end c. undo d. None of the above.
Q30. Which of the following jQuery method searches for descendent elements that match the specified
selectors?
a. locateselector b. findselector c. searchselector d. None of the above.
Q31. Which of the following jQuery method gets a set of elements containing the unique next siblings of each of
the given set of elements?
a. locateNextselector b. getNextselector c. nextselector d. None of the above.
Q32. Which of the following jQuery method finds all sibling elements after the current element?
a. locateNextAllselector b. getNextAllselector c. nextAllselector d. None of the above.
Q33. Which of the following jQuery method returns a jQuery collection with the positioned parent of the first
matched element?
a. offsetParentselector b. offsetselector c. parentselector d. None of the above.
Q34. Which of the following jQuery method gets the direct parent of an element?
a. offsetParentselector b. offsetselector c. parentselector d. None of the above.
Q35. Which of the following jQuery method gets a set of elements containing the unique ancestors of the
matched set of elements?
a. offsetParentselector b. offsetselector c. parentsselector d. None of the above.
Q36. Which of the following jQuery method gets a set of elements containing the unique previous siblings of
each of the matched set of elements?
a. parentsselector b. prevselector c. siblingsselector d. None of the above.
Q37. Which of the following jQuery method finds all sibling elements in front of the current element?
a. parentsselector b. prevAllselector c. siblingsselector d. None of the above.
11
Vidyanidhi Info Tech Academy
Vidyanidhi Info Tech Academy
PG DAC Question Bank
Q38. Which of the following jQuery method gets a set of elements containing all of the unique siblings of each of
the matched set of elements?
a. parentsselector b. prevAllselector c. siblingsselector d. None of the above.
Q39. Which of the following jQuery method gets the style property of an element?
a. getClassname b. getStylename c. cssname d. None of the above.
Q40. Which of the following jQuery method sets the style property of an element?
a. setClassname, value b. setStylename, value c. cssname, value d. None of the above.
Q41. Which of the following jQuery method sets the height property of an element?
a. setCSSHeightvalue b. setHeightvalue c. heightvalue d. None of the above.
Q42. Which of the following jQuery method gets the height property of an element?
a. getCSSHeight b. getHeight c. height d. None of the above.
Q43. Which of the following jQuery method sets the width property of an element?
a. setCSSWidthvalue b. setWidthvalue c. widthvalue d. None of the above.
Q44. Which of the following jQuery method gets the width property of an element?
a. getCSSWidth b. getWidth c. width d. None of the above.
Q45. Which of the following jQuery method gets the inner height excludingtheborder of an element?
a. getCSSHeight b. innerHeight c. getInnerHeight d. None of the above.
Q46. Which of the following jQuery method gets the inner width excludingtheborder of an element?
a. getCSSWidth b. innerWidth c. getInnerWidth d. None of the above.
Q47. Which of the following jQuery method gets the current offset of the first matched element, in pixels,
relative to the document?
a. offset b. offsetParent c. position d. None of the above.
Q48. Which of the following jQuery method returns a jQuery collection with the positioned parent of the first
matched element?
a. offset b. offsetParent c. position d. None of the above.
Q49. Which of the following jQuery method returns the top and left position of an element relative to its offset
parent?
a. offset b. offsetParent c. position d. None of the above.
Q50. Which of the following jQuery method returns the outer height including the border of an element?
a. getCSSHeight b. getHeight c. outerHeight[margin] d. None of the above.
Q52. Which built-in method combines the text of two strings and returns a new string?
a. append() b. concat() c. attach() d. None of the above.
12
Vidyanidhi Info Tech Academy
Vidyanidhi Info Tech Academy
PG DAC Question Bank
Q53. Which of the following jQuery selector select elements whose css class is some-class?
a. $('some-class') b. $('#some-class') c. $('.some-class') d. None of the above.
Q54. Which of the following jQuery method gets the html contents (innerHTML) of the first matched element?
a. html( ) b. getHtml( ) c. getInnerHtml( ) d. None of the above.
Q55. Which of the following jQuery method adds more elements, matched by the given selector, to the set of matched
elements?
a. add( selector ) b. addElement( selector ) c. append(selector) d. None of the above.
Q56. Which of the following jQuery method reverts the most recent 'destructive' operation, changing the set of
matched elements to its previous state?
a. revert( ) b. end( ) c. undo( ) d. None of the above.
Q57. Which of the following jQuery method gets the width property of an element?
a. getCSSWidth( ) b. getWidth( ) c. width( ) d. None of the above.
Q58. Which of the following jQuery method gets the current offset of the first matched element, in pixels,
relative to the document?
a. offset( ) b. offsetParent( ) c. position( ) d. None of the above.
Q59. Which of the following jQuery method stops the bubbling of an event to parent elements?
a. preventDefault( ) b. stopImmediatePropagation( ) c. stopPropagation( ) d. None of the above.
Q60. Which of the following jQuery method loads a remote page using an HTTP GET request?
a. jQuery.get( url, [data], [callback], [type] ) b. jQuery.getJSON( url, [data], [callback] )
c. jQuery.getScript( url, [callback] ) d. jQuery.post( url, [data], [callback], [type] )
Q67. The jQuery html() method works for both HTML and XML documents
a. True b. False
Q68. What is the correct jQuery code to set the background color of all p elements to red?
a. $("p").manipulate("background-color","red"); b. $("p").style("background-color","red");
13
Vidyanidhi Info Tech Academy
Vidyanidhi Info Tech Academy
PG DAC Question Bank
c. $("p").css("background-color","red"); d. $("p").layout("background-color","red");
Q69. With jQuery, look at the following selector: $("div.intro"). What does it select?
a. The first div element with id="intro" b. All div elements with class="intro"
c. The first div element with class="intro" d. All div elements with id="intro"
Q71. Which jQuery method is used to set one or more style properties for selected elements?
a. css() b. style() c. html()
Q76. Which jQuery function is used to prevent code from running, before the document is finished loading?
a. $(document).ready() b. $(document).load() d. $(body).onload()
Q77. Which jQuery method should be used to deal with name conflicts?
a. noNameConflict() b. nameConflict() c. noConflict() d. conflict()
Q78. Which jQuery method is used to switch between adding/removing one or more classes (for CSS) from selected
elements?
a. toggleClass() b. switch() c. altClass() d. switchClass()
Q79. Look at the following jQuery selector: $("div#intro .head"). What does it select?
a. All elements with class="head" inside the div element with id="intro"
b. All div elements with id="intro" or class="head"
c. The first element with id="head" inside any div element with class="intro"
Q81. What will happen by $("#wblogo").html() It will return html from wblogo id element a.
a. It will set blank html to wblogo id element b. It will return html from wblogo id element
c. It will set blank html to wblogo class element
Q82. With jQuery, look at the following selector: $("div.intro"). What does it select?
14
Vidyanidhi Info Tech Academy
Vidyanidhi Info Tech Academy
PG DAC Question Bank
a. The first div element with class="intro" b. All div elements with class="intro"
c. The first div element with id="intro" d. All div elements with id="intro"
Q84. How can you get href value from <a href=\"http://www.xchanging.com\" id=\"logo\"/>
a. $("#logo").attr("#href") b. $("logo").("href") d. $("#logo").attr("href") d. $("#logo").href
Q85. What is the correct jQuery code to set the background color of all p elements to red?
a. $("p").manipulate("background-color","red"); b. $("p").style("background-color","red");
c. $("p").layout("background-color","red"); d. $("p").css("background-color","red");
Q86. Which jQuery method is used to switch between adding/removing one or more classes (for CSS) from
selected elements?
a. switchClass() b. addRemoveClass() c. altClass() d. toggleClass()
Q90. How to set attribute title=”link” for anchor tag dynamically in jQuery
a. $(“a”).attr(“title”,”link”) b. $(“a”).val(title=”link”); c. $(“a”).attr(title=”link”); d. none
Node JS
Q1. Which of the following is true about Node.JS?
a. Node.js is a JavaScript based framework/platform built on Google Chrome's JavaScript V8 Engine.
b. Node.JS is used to delevop I/O intensive web applications like video streaming sites, single page applications
and other web application.
c. Node.js is open source and is completely free to use.
d. All of the above.
Q2.What is Node.JS?
a. Node.js is a web server.
b. Node.js is a JavaScript based framework/platform built on Google Chrome's JavaScript V8 Engine.
c. Node.js is a java based framework
d. None of the above.
15
Vidyanidhi Info Tech Academy
Vidyanidhi Info Tech Academy
PG DAC Question Bank
Q4. Why code written in Node.JS is pretty fast although being written in JavaScript?
a. Node.JS internally converts JavaScript code to Java based code and then execute the same.
b. Node.JS internally converts JavaScript code to C based code and then execute the same.
c. Being built on Google Chrome's V8 JavaScript Engine.
d. None of the above.
Q5. How Node based web servers are different from traditional web servers?
a. Node based server process request much faster than traditional server.
b. Node based server uses a single threaded model and can services much larger number of requests than
traditional server like Apache HTTP Server.
c. There is no much difference between the two.
d. None of the above.
Q17. Which of the following command will show all the modules installed globally?
a. $ npm ls –g b. $ npm ls c. $ node ls –g d. $ node ls
Q18. Which of the following command will show all the modules installed locally.
a. $ npm ls –g b. $ npm ls c. $ node ls –g d. $ node ls
17
Vidyanidhi Info Tech Academy
Vidyanidhi Info Tech Academy
PG DAC Question Bank
Angular JS 2
1) Which of the following is correct about Angular 2 Components?
a) AngularJS had a focus of Controllers but Angular 2 has changed the focus to having components over
controllers.
b) Components help to build the applications into many modules.
c) This helps in better maintaining the application over a period of time.
d) All of the above.
10) Which of the following is correct about Export Array in Angular 2 Modules?
a) This is used to export components, directives, and pipes which can then be used in other modules.
b) This is used to export services which can then be used in other services.
c) Both of the above.
d) None of the above.
11) Which of the following is correct about Import Array in Angular 2 Modules?
a) Import array can be used to import the functionality from other Angular JS modules.
b) Import array can be used to import the templates.
c) Both of the above.
d) None of the above.
22) Which of the following filter is used to convert input to all lowercase?
a) lowercase b) lower c) Both of the above. d) None of the above.
24) Which of the following filter is used to convert input to all uppercase?
a) uppercase b) upper c) Both of the above. d) None of the above.
25) Which of the following filter is used to slice a piece of data from the input string.
a) slice b) substring c) Both of the above. d) None of the above.
26) Which of the following filter is used to convert an input string to date format.
20
Vidyanidhi Info Tech Academy
Vidyanidhi Info Tech Academy
PG DAC Question Bank
a) dateformat b) date c ) Both of the above. d) None of the above.
27) Which of the following filter is used to convert an input string to currency format.
a) currency b) amount c) Both of the above. d) None of the above.
28) Which of the following filter is used to convert an input string to percentage format.
a) percentage b) percent c) Both of the above. d) None of the above.
38) Which of the following is correct about Bootstrap Array in Angular 2 Modules?
a) This is used to tell Angular JS which components need to be loaded so that its functionality can be
accessed in the application.
b) Once you include the component in the bootstrap array, you need to declare them so that they can be
used across other components in the Angular JS application.
c) Both of the above.
d) None of the above.
Explanation
Angular 2 Bootstrap array is used to tell Angular which components need to be loaded so that its functionality
can be accessed in the application. Once you include the component in the bootstrap array, you need to
declare them so that they can be used across other components in the Angular application.
42) Which of the following is correct about Import Array in Angular 2 Modules?
a) Import array can be used to import the functionality from other Angular JS modules.
b) Import array can be used to import the templates.
c) Both of the above.
d) None of the above.
Explanation
Angular 2 Import array can be used to import the functionality from other Angular JS modules.
44) Which of the following filter is used to convert input to all uppercase?
a) uppercase b) upper c) Both of the above. d) None of the above.
Explanation
uppercase filter is used to convert the input to all uppercase.
52) Which of the following filter is used to convert an input string to currency format.
a) currency b) amount c) Both of the above. d) None of the above.
Explanation
currency filter is used to convert an input string to currency format.
Explanation
ngOnInit method is called whenever the initialization of the directive/component after Angular first displays
the data-bound properties happens.
55) Which of the following is correct about Export Array in Angular 2 Modules?
a) This is used to export components, directives, and pipes which can then be used in other modules.
b) This is used to export services which can then be used in other services.
c) Both of the above.
d) None of the above.
Explanation
Angular 2 Export array is used to export components, directives, and pipes which can then be used in other
modules.
25
Vidyanidhi Info Tech Academy
Vidyanidhi Info Tech Academy
PG DAC Question Bank
59) Which of the following is correct about package.json?
a) There are two types of dependencies, first is the dependencies and then there are dev dependencies.
b) The dev ones are required during the development process and the others are needed to run the
application.
c) Both of the above.
d) None of the above.
Explanation
There are two types of dependencies, first is the dependencies and then there are dev dependencies. The dev
ones are required during the development process and the others are needed to run the application.
61) Which of the following filter is used to convert an input string to date format.
a) dateformat b) date c) Both of the above. d) None of the above.
Explanation
date filter is used to convert an input string to date format.
65) Which of the following filter is used to slice a piece of data from the input string.
a) slice b) substring c) Both of the above. d) None of the above.
Explanation
slice filter is used to slice a piece of data from the input string.
66) Which of the following filter is used to convert input to all lowercase?
a) lowercase b) lower c) Both of the above. d) None of the above.
Explanation
lowercase filter is used to convert the input to all lowercase.
68) Which of the following filter is used to convert an input string to percentage format.
a) percentage b) percent c) Both of the above. d) None of the above.
Explanation
percent filter is used to convert an input string to percentage format.
73) Which of the following is correct about Import Array in Angular 2 Modules?
a) Import array can be used to import the functionality from other Angular JS modules.
b) Import array can be used to import the templates.
c) Both of the above.
d) None of the above.
Explanation
Angular 2 Import array can be used to import the functionality from other Angular JS modules.
76) Which of the following filter is used to convert input to all uppercase?
a) uppercase b) upper c) Both of the above. d) None of the above.
Explanation
uppercase filter is used to convert the input to all uppercase.
77) Which of the following filter is used to convert an input string to percentage format.
a) percentage b) percent c) Both of the above. d) None of the above.
Explanation
percent filter is used to convert an input string to percentage format.
28
Vidyanidhi Info Tech Academy
Vidyanidhi Info Tech Academy
PG DAC Question Bank
78) Which of the following is correct about lifecycle hook - ngAfterContentInit.
a) When the value of a data bound property changes, then this method is called.
b) This is called whenever the initialization of the directive/component after Angular first displays the data-
bound properties happens.
c) This is for the detection and to act on changes that Angular can't or won't detect on its own.
d) This is called in response after Angular projects external content into the component's view.
Explanation
ngAfterContentInit method is called in response after Angular projects external content into the component's
view.
83) Model available in $rootScope can be overridden by its all child scopes.
a. true b. false
84) service method is used to create a service whose purpose is to do some defined task.
a. true b. false
85) On which of the following types of component can we create a custom directive?
a. Element directives b. Attribute c. CSS d. All of the above.
86) With Angular JS, developer writes less code and gets more functionality.
a. true b. false
87) ng-init directive can be used to put values to the variables to be used in the application.
a. true b. false
88) We can use $dirty and $invalid flags to do the form validations.
a. true b. false
29
Vidyanidhi Info Tech Academy