TypeError: undefined is not an object (evaluating 'this.variable')

This page is supposed to read a JSON and get the array I have stored but for whatever reason I cannot access a variable from within my constructor().

private recGalleries = new Array;

  constructor(private menu: MenuService, private nav: NavController) {
    GalleryData.Galleries.forEach(function(element) {
      this.recGalleries.push(element.name);         //<--ERR HERE
    });
    console.log(this.recGalleries);
  }

This is the error output:

Error: Uncaught (in promise): TypeError: undefined is not an object (evaluating 'this.recGalleries') http://localhost:8100/Pages-home-home-module.js:107:17 forEach@[native code] HomePage@http://localhost:8100/Pages-home-home-module.js:106:83 createClass@http://localhost:8100/vendor.js:58072:28 createDirectiveInstance@http://localhost:8100/vendor.js:57949:31 createViewNodes@http://localhost:8100/vendor.js:59175:59 createRootView@http://localhost:8100/vendor.js:59089:20 callWithDebugContext@http://localhost:8100/vendor.js:60097:30 create@http://localhost:8100/vendor.js:57428:43 createComponent@http://localhost:8100/vendor.js:57539:51 activateWith@http://localhost:8100/vendor.js:84220:68 activateRoutes@http://localhost:8100/vendor.js:72703:52 http://localhost:8100/vendor.js:72654:33 forEach@[native code] activateChildRoutes@http://localhost:8100/vendor.js:72653:36 activateRoutes@http://localhost:8100/vendor.js:72710:41 http://localhost:8100/vendor.js:72654:33 forEach@[native code] activateChildRoutes@http://localhost:8100/vendor.js:72653:36 activate@http://localhost:8100/vendor.js:72578:33 http://localhost:8100/vendor.js:72562:22 _next@http://localhost:8100/vendor.js:94594:39 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:97318:30 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:94600:30 next@http://localhost:8100/vendor.js:89308:23 notifyNext@http://localhost:8100/vendor.js:96957:30 _next@http://localhost:8100/vendor.js:88527:31 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:94600:30 next@http://localhost:8100/vendor.js:89308:23 http://localhost:8100/vendor.js:91487:24 _trySubscribe@http://localhost:8100/vendor.js:88689:35 subscribe@http://localhost:8100/vendor.js:88675:35 subscribe@http://localhost:8100/vendor.js:88670:26 _innerSub@http://localhost:8100/vendor.js:96936:115 _next@http://localhost:8100/vendor.js:96926:23 next@http://localhost:8100/vendor.js:89308:23 notifyNext@http://localhost:8100/vendor.js:96957:30 _next@http://localhost:8100/vendor.js:88527:31 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:94600:30 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:97318:30 next@http://localhost:8100/vendor.js:89308:23 notifyNext@http://localhost:8100/vendor.js:94884:30 _next@http://localhost:8100/vendor.js:88527:31 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:94600:30 next@http://localhost:8100/vendor.js:89308:23 _complete@http://localhost:8100/vendor.js:97124:33 complete@http://localhost:8100/vendor.js:89320:27 _complete@http://localhost:8100/vendor.js:89338:34 complete@http://localhost:8100/vendor.js:89320:27 _complete@http://localhost:8100/vendor.js:94879:38 complete@http://localhost:8100/vendor.js:89320:27 http://localhost:8100/vendor.js:99985:32 _trySubscribe@http://localhost:8100/vendor.js:88689:35 subscribe@http://localhost:8100/vendor.js:88675:35 subscribe@http://localhost:8100/vendor.js:88670:26 subscribe@http://localhost:8100/vendor.js:88670:26 subscribe@http://localhost:8100/vendor.js:88670:26 subscribe@http://localhost:8100/vendor.js:88670:26 _innerSub@http://localhost:8100/vendor.js:94874:90 _tryNext@http://localhost:8100/vendor.js:94868:23 _next@http://localhost:8100/vendor.js:94851:26 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:97318:30 next@http://localhost:8100/vendor.js:89308:23 http://localhost:8100/vendor.js:91487:24 _trySubscribe@http://localhost:8100/vendor.js:88689:35 subscribe@http://localhost:8100/vendor.js:88675:35 subscribe@http://localhost:8100/vendor.js:88670:26 subscribe@http://localhost:8100/vendor.js:88670:26 subscribe@http://localhost:8100/vendor.js:88670:26 subscribe@http://localhost:8100/vendor.js:88670:26 _innerSub@http://localhost:8100/vendor.js:96936:115 _next@http://localhost:8100/vendor.js:96926:23 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:94039:34 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:97318:30 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:97318:30 next@http://localhost:8100/vendor.js:89308:23 notifyNext@http://localhost:8100/vendor.js:94884:30 _next@http://localhost:8100/vendor.js:88527:31 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:94600:30 next@http://localhost:8100/vendor.js:89308:23 notifyNext@http://localhost:8100/vendor.js:94884:30 _next@http://localhost:8100/vendor.js:88527:31 next@http://localhost:8100/vendor.js:89308:23 _complete@http://localhost:8100/vendor.js:93048:34 complete@http://localhost:8100/vendor.js:89320:27 _complete@http://localhost:8100/vendor.js:89338:34 complete@http://localhost:8100/vendor.js:89320:27 _complete@http://localhost:8100/vendor.js:89338:34 complete@http://localhost:8100/vendor.js:89320:27

SOLVED:
In order to access the variables from the home page the line

GalleryData.Galleries.forEach(function(element) {
...
});

should be written

GalleryData.Galleries.forEach((element) => {
...
});