FAC-Sixteen / Week3-Magic3

FAC Week3 Project
https://fac-sixteen.github.io/Week3-Magic3/
0 stars 2 forks source link

ES6 #21

Closed charlielafosse closed 5 years ago

charlielafosse commented 5 years ago

Sweet ES6 m'dudes :+1:

But just keep thinking about let and const... you use let quite a few times in your script.js when const would've done just fine. For example

let a = document.getElementById('foodSelector');

Sure, you add an event listener to a on the next line, but you're not reassigning a at all.

A small point though!

charlielafosse commented 5 years ago

Oh and on another note... if you are going to use ES6, make sure you fully commit and don't slide between ES5 and ES6. Lines 53-54 in your script.js:

const url = 'https://www.themealdb.com/api/json/v1/1/random.php';
  var xhr = new XMLHttpRequest();

For best practices, try to agree as a group before you begin, if you're going to stick with ES5, or go all-out ES6.

rymatech commented 5 years ago

Thanks for pointing it out. We get very nervous with const. I have resolved the issue now.