Arrays’s Objects property is either true or false but becomes always false when accessed in a loop

I’m facing an unexpected situation. I have some objects(array). Those have a property break, that is boolean. break value depends upon situation, but it becomes always false when compared in if statement, in a for or for of loop. I tried to change the style of if by using ==, === and only property, but all do the same result, even when some of objects have value true. Simply saying, when the array of object is iterated, the object’s break property becomes false, even if it it true. Language is TypeScript.

Following is method

private allocateNights() {
    console.log(this.route);

    for (let i = 0; i < this.route.length; i++) {
      if (this.route[i].break) {
        Object.defineProperty(this.route[i], 'nights', {
          value: 0,
          writable: true
        });

        if (this.route[i].activityTime <= 7) {
          this.route[i].nights = 1;
        } else if (this.route[i].activityTime <= 14) {
          this.route[i].nights = 2;
        } else {
          this.route[i].nights = 3;
        }
      } else {
        console.log(this.route[i].break);
      }
    }

    console.log(this.route);
    return of(this.route);
  }

Following is the log

Angular is running in the development mode. Call enableProdMode() to enable the production mode. core.js:38781
(5) […]
​
0: {…}
​​
activities: Array [ {…} ]
​​
activityTime: 3
​​
break: true
​​
cityCode: "ELL"
​​
<prototype>: Object { … }
​
1: {…}
​​
activities: Array [ {…} ]
​​
activityTime: 5
​​
break: false
​​
cityCode: "NUW"
​​
<prototype>: Object { … }
​
2: {…}
​​
activities: Array [ {…}, {…} ]
​​
activityTime: 10
​​
break: true
​​
cityCode: "KAN"
​​
<prototype>: Object { … }
​
3: {…}
​​
activities: Array [ {…} ]
​​
activityTime: 5
​​
break: false
​​
cityCode: "YAL"
​​
<prototype>: Object { … }
​
4: {…}
​​
activities: Array(3) [ {…}, {…}, {…} ]
​​
activityTime: 12
​​
break: true
​​
cityCode: "GAL"
​​
<prototype>: Object { … }
​
length: 5
​
<prototype>: Array []
route.service.ts:118:12

----------------------------------------------------
false 5 route.service.ts:135:16
----------------------------------------------------
(5) […]
​
0: {…}
​​
activities: Array [ {…} ]
​​
activityTime: 3
​​
break: true
​​
cityCode: "ELL"
​​
<prototype>: Object { … }
​
1: {…}
​​
activities: Array [ {…} ]
​​
activityTime: 5
​​
break: false
​​
cityCode: "NUW"
​​
<prototype>: Object { … }
​
2: {…}
​​
activities: Array [ {…}, {…} ]
​​
activityTime: 10
​​
break: true
​​
cityCode: "KAN"
​​
<prototype>: Object { … }
​
3: {…}
​​
activities: Array [ {…} ]
​​
activityTime: 5
​​
break: false
​​
cityCode: "YAL"
​​
<prototype>: Object { … }
​
4: {…}
​​
activities: Array(3) [ {…}, {…}, {…} ]
​​
activityTime: 12
​​
break: true
​​
cityCode: "GAL"
​​
<prototype>: Object { … }
​
length: 5
​
<prototype>: Array []
route.service.ts:139:12

Source: New feed
Source Url Arrays’s Objects property is either true or false but becomes always false when accessed in a loop