0
I would like to know how to add a prototype to a function that is already instantiated in a prototype. Example below:
app js.
'use strict';
function NivFire(){
this.db = "", this.admin = "", this.reference;
}
NivFire.prototype = {
Fire : function(credential,url){},
Ref : function(ref){ }
};
NivFire.prototype.Ref.prototype = {
Set: (args) => {},
Push: (args) => {}
};
module.exports = NivFire;
main.js
var NivFire = require("./app.js");
var nivfire = new NivFire();
nivfire.Fire( require('./nivellirfirebase.json'), "https://nivellir-97d87.firebaseio.com" );
nivfire.Ref("users").Set({
name : "User1"
});
When this code is executed, it returns the Typeerror: Cannot read Property 'Set' of Undefined.