javascript what is a node code example
Example 1: what is node.js
Javascript was always a client side language until node.js.
Common server side languages include PHP, Python, Perl, Ruby
and several more. Node enables you to use Javascript server side.
This now means you can have a consistent language both ends
which could not be done prior to Node.
Example 2: what is a node
Is a child of EventTarget
Node = DOM objects = Attr, CharacterData (which Text, Comment, and CDATASection are all based on), ProcessingInstruction, DocumentType, Notation, Entity, and EntityReference.
function isNode(o){
return (
typeof Node === "object" ? o instanceof Node :
o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName==="string"
);
}