DEV Community

loading...

Discussion on: How to build a Router with vanilla JavaScript

Collapse
vijskt profile image
Vijay Jangid

Nicely done.

$0.02 from me take it or leave it.

constructor(){
  this.routes = [];
  return this; // I don't think this is explicitly required 
                     // (unless you want to return something else than 'this')
}
Collapse
kodnificent profile image
Victor Mbamara 🇳🇬 Author

Very true Vijay, It'll only be required if i wanted to chain methods. I'll edit accordingly. Thanks for noting that.