Sunday 21 May 2017

create a new class instance in JS

I know that these two scripts are correct and are identical but I need to know what is the most used:

const EventEmitter = require('events');

class MyEmitter extends EventEmitter {}
const myEmitter = new MyEmitter();

and

var Emitter = require('events');

var emtr = new Emitter();



via Mohamed Ben HENDA

No comments:

Post a Comment