FACN3 / mashrou_ghazal

project autocomplet
http://tiny.cc/MashrouGhazal
Apache License 2.0
1 stars 0 forks source link

Mixture of ES5 and ES6 #34

Open matthewdking opened 6 years ago

matthewdking commented 6 years ago

In handler.js you are using a mixture of ES5 and ES6. Eg

ES6 arrow function

fs.readFile(__dirname + '/words.txt', (err, data) => {
  if (err) {

ES5 function

function handler(request, response) {
  var url = request.url;

For consistency I would suggest picking one and sticking with it. In the back end use ES6 where possible :+1:

shiryz commented 6 years ago

if you're going with es6 then you should use const to declare some variables that will never change throughout the code for example functions that you'll use https://github.com/FACN3/mashrou_ghazal/blob/master/src/handler.js#L1

hoslack commented 6 years ago

Noted @shiryz @matthewdking