As i understand it, the connect function has to return a new object like this:
exports.connect = function(arg) {
return new Date(arg);
}; var Date=function(arg) { this.value=arg;
console.log('Its alle about Date: '+this.value);
};
Then you are able to create it like this:
var d1=require('date').connect('Object_1'); var d2=require('date').connect('Object_2');
your output should be like this:
Its alle about Date: Object_1 Its alle about Date: Object_2
Sacha
@Sacha started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
As i understand it, the connect function has to return a new object like this:
exports.connect = function(arg) {
};
var Date=function(arg) {
this.value=arg;
};
Then you are able to create it like this:
var d1=require('date').connect('Object_1');
var d2=require('date').connect('Object_2');
your output should be like this:
Its alle about Date: Object_1
Its alle about Date: Object_2
Sacha