Avoiding the use of the for…in loop over an array

When tailoring HPE Service Manager, you often need to iterate over an array. However, using a for…in loop to iterate over an array may return unexpected results, particularly, in the two scenarios illustrated below. HPE recommends that you use the for ([initialization]; [condition]; [final-expression]) loop instead when iterating over an array object.

For more information about using the for...in statement, refer to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in.