loading...

re: How to build a Router with vanilla JavaScript VIEW POST

FULL DISCUSSION
 

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')
}
 

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

Code of Conduct Report abuse