Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Mixture of ES5 and ES6 #34

Open
matthewdking opened this issue Nov 23, 2017 · 2 comments
Open

Mixture of ES5 and ES6 #34

matthewdking opened this issue Nov 23, 2017 · 2 comments
Assignees
Labels

Comments

@matthewdking
Copy link

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 👍

@shiryz
Copy link

shiryz commented Nov 23, 2017

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
Copy link
Member

hoslack commented Nov 23, 2017

Noted @shiryz @matthewdking

@Amirk390 Amirk390 removed their assignment Nov 23, 2017
@Amirk390 Amirk390 added the fixed label Nov 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants