Thursday 10 February 2022

Nodejs - Prototype

 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

Kotlin - Observer

 Rxjava -  Observer - Based on data view willl render (react) karega. trotling -> making stream for execution (Means clicks event fire kr...