Saurabh3333 / give-me-a-joke

A npm-module for random and customized jokes.
https://www.npmjs.com/package/give-me-a-joke
MIT License
14 stars 10 forks source link

Convert to es6 #17

Closed NikanZeyaei closed 3 years ago

NikanZeyaei commented 3 years ago

Converted all the function statements to arrow functions and also converted the .thens to the new ES6's Async/Await syntax Also the use of the var keyword is prohibited in modern JavaScript so I converted all the the var s to their appropriate consts and lets

Saurabh3333 commented 3 years ago

Thanks for the contribution. I think many people are still using the old convention. Maybe we should write something which can support both the conventions?

NikanZeyaei commented 3 years ago

Thanks for the contribution. I think many people are still using the old convention. Maybe we should write something which can support both the conventions?

Using the old JavaScript conventions like var can be dangerous because of the scoping issues Also the only browser that doesn't support Async/Await's syntactic sugar in 2021 is Microsoft's Internet Explorer I think atleast the var issue in the codebase should be addressed because it can be dangerous and may lead to bugs if you decide to grow the project

Saurabh3333 commented 3 years ago

You are right. Can you please raise one pull request just with var to const changes. If you are interested in growing this project with a sustainable approach, you are always welcome. 😊

NikanZeyaei commented 3 years ago

You are right. Can you please raise one pull request just with var to const changes. If you are interested in growing this project with a sustainable approach, you are always welcome. 😊

Sure