Last active
November 13, 2016 13:20
-
-
Save smks/d41c2d6778a3a23965eaea726af2bd01 to your computer and use it in GitHub Desktop.
Use of Constant and Let
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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