Replace a bunch of Array.prototype.forEach() cases with for...of loops instead

Using `for...of` is a modern and generally much nicer pattern, since it gets rid of unnecessary callback-functions. (In a couple of spots, a "regular" `for` loop had to be used.)
This commit is contained in:
Jonas Jenwald 2021-04-24 12:36:01 +02:00
parent da0e7ea969
commit da22146b95
14 changed files with 67 additions and 71 deletions

View file

@ -1394,9 +1394,9 @@ class PartialEvaluator {
) {
const groupIds = [];
if (Array.isArray(optionalContentGroups)) {
optionalContent.get("OCGs").forEach(ocg => {
for (const ocg of optionalContentGroups) {
groupIds.push(ocg.toString());
});
}
} else {
// Dictionary, just use the obj id.
groupIds.push(optionalContentGroups.objId);