I have the following namespace,
var app = {
w: 200,
h: 200,
spacing: 5,
dataList:[
// 1st column
[1 * this.w, 1 * this.h, 0 * this.w, 0 * this.h, 'bedroom.jpg', 'Bedroom 1'],
[1 * this.w, 1 * this.h, 0 * this.w, 1 * this.h, 'topFloorLounge.jpg', 'Top floor lounge'],
[1 * this.w, 1 * this.h, 0 * this.w, 2 * this.h, 'garage.jpg', 'Garage'],
// 2nd column
[2 * this.w, 2 * this.h, 1 * this.w, 0 * this.h, 'livingRoom2.jpg', 'Living room 2'],
[1 * this.w, 1 * this.h, 1 * this.w, 2 * this.h, 'gym.jpg', 'Gym']
]}
but when I console log my dataList, the result for the dataList[0] is:
0: NaN
1: NaN
2: NaN
3: NaN
4: "bedroom.jpg"
5: "Bedroom 1"
obviously, 'this.w' within the array is not referring to w:200 in the same namespace, what have I done wrong? any suggestions is much appreciated.
Thanks