Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var entries = [
- {"id":1, "title":"Hello World!", "body":"This is the body of my blog entry. Sooo exciting.", "published":"01/01/2017"}];
- exports.getBlogEntries = function() {
- return entries;
- }
- exports.getBlogEntry = function(id) {
- for(var i=0; i < entries.length; i++) {
- if(entries[i].id == id) return entries[i];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement