Node JS Quiz Questions and Answers

Answer :
  • compareDocumentPosition()

Explanation :

The compareDocumentPosition() method is used to compare the placement of two nodes in the DOM hierarchy (document). The return value is an integer value whose bits represent the calling Node’s relationship to otherNode within the Document.
Answer :
  • Returns the associated object

Explanation :

The method getUserData(key) returns the object associated to a key on a this node. The object must first have been set to this node by calling setUserData with the same key.
Answer :
  • previousSibling

Explanation :

The node object property previousSibling returns the node immediately before a node. The returned node is returned as a Node object.
Answer :
  • Returns the root element

Explanation :

The ownerDocument property returns the owner document of a node, as a Document object. It returns the root element for a node.
Answer :
  • path.join('/test', 'test1', '2slashes/1slash', 'tab', '..')

Explanation :

path.join([path1][, path2][, ...]) joins all arguments together and normalize the resulting path.
Answer :
  • chaining process

Explanation :

chaining process is an approach to connect the output of one stream to the input of another
Answer :
  • console.log('endianness : ' + os.endianness());

Explanation :

os.endianness() returns the endianness of the CPU. Possible values are "BE" or "LE".
Answer :
  • eventEmitter

Explanation :

EventEmitter is used to create and consume custom events in Node.js
Answer :
  • Node-static

Explanation :

Node-static is used to serve static resources in Node.js
Answer :
  • Testing Node.js/JavaScript expressions

Explanation :

Repl is used for Testing node.js/JavaScript expressions.