Global Objects
-> We have two js files for accessing main.js objects we are using this functions in object.js
1)main.js
var person = function(a,b){
var c = a+b
console.log("sum of "+ a +" and "+ b +" is "+ c)
}
person(5,5);
2)global_objects.js
var main = require("./mian")
console.log(__dirname)
console.log(__filename)
output
sum of 5 and 5 is 10
K:\NodeJs\Node Basics\chapter-1
K:\NodeJs\Node Basics\chapter-1\globalObject.js
No comments:
Post a Comment