I have a simple question that I am struggling with as a student.
Here is the method in question:
getMenus: function () {
var self=this;
$.getJSON('../data/voordeelmenus.json',function(data){
self.menus=$.map(data, function(item, i){
return new Menu(item.id,item.naam,item.type,item.omschrijving,item.samenstelling,item.prijs);
});
self.menusToHtml();
});
The purpose of this method is to retrieve menus from a JSON file and create objects using the Menu constructor. These objects are then stored in the menus array. After this step, I want to test if the objects were successfully stored by printing them out in the console. I attempted to do this with console.log(self.menus) but it did not work as expected.