Hi! It would be easier knowing which task this is. I’m not that good at this but I think you should state that getPages is a function like so:
this.getPages = function(){
return pages;
};
and then do the same with setPages but passing the function your num argument:
this.setPages = function(num){
pages = num;
};
In setPages if you use this.pages then it doesn’t update the page number. Therefore, just ascribe a new value to pages (pages = num).
This way it works, at least for me.
Hope this helps.