prototype = provide ability for adding new methods or class (Example- Inherit)
1) Home.js
var cal = require("./addition");
cal.addition();
console.log(cal.aval)
2) addition.js
module.exports={
addition:function(){
console.log("this is addition module");
},
aval:20
}
o/p ->
this is addition module
20
No comments:
Post a Comment