我这辈子都弄不明白这个脚本有什么问题

I cant for the life of me figure out whats wrong with this script

var cb1 = this.getField("Check Box1").isBoxChecked(0); 
var cb2 = this.getField("Check Box3").isBoxChecked(0); 
var cb3 = this.getField("Check Box4").isBoxChecked(0); 
var cb4 = this.getField("Check Box5").isBoxChecked(0); 
var cb5 = this.getField("Check Box6").isBoxChecked(0); 
var cb6 = this.getField("Check Box7").isBoxChecked(0); 
var cb7 = this.getField("Check Box8").isBoxChecked(0); 

if (cb1 && cb2 && cb3 && cb4 && cb5 && cb6 && cb7)
{ event.value = "0"; } 

let totalDays = this.getField("Totaldays").value;
[
{checked: cb1, rentalRate: 0}, {checked: cb2, rentalRate: 30}, {checked: 
cb3, rentalRate: 20}, {checked: cb4, rentalRate: 0}, {checked: cb5, 
rentalRate: 40}, {checked: cb6, rentalRate: 0}, {checked: cb7, rentalRate: 
0} 
]
.filter(item => item.checked) .forEach(item => { let rentalFee = 
item.rentalRate * totalDays; event.value += rentalFee; });

它一直说有一个 "syntax error: Missing ; before statement." 有没有人看到我遗漏的任何明显的东西?我觉得我需要一双全新的眼睛来审视它。我在 Adob​​e Acrobat DC 工作,仅供参考。在图像中,我画了一个箭头来突出显示并提到箭头。提前致谢!

Syntax Error

请注意,目前 Adobe Acrobat DC seems to use javascript version 1.5(ECMA-262 第 3 版)尚未实现您使用的功能。

您应该首先尝试替换箭头函数(在 ECMA-262 第 6 版中介绍):

.filter(function (item) {
  return item.checked;
}).forEach(function (item) {
  var rentalFee = item.rentalRate * totalDays;event.value += rentalFee;
});