Skip to content

Instantly share code, notes, and snippets.

@smks
Last active November 13, 2016 13:20
Show Gist options
  • Save smks/d41c2d6778a3a23965eaea726af2bd01 to your computer and use it in GitHub Desktop.
Save smks/d41c2d6778a3a23965eaea726af2bd01 to your computer and use it in GitHub Desktop.
Use of Constant and Let
// this has to be today's date.
const dateToday = '12-11-2016';
fetch('http://opencanvas.co.uk/ocl/api/fruits?date=' + dateToday)
.then(function(res) {
return res.json();
})
.then(function(json) {
const fruits = json.fruits;
for (let index in fruits) {
console.log(fruits[index]);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment