I am learning to use google closure compiler for javascript but have strange compile error
I get this message:
ctest2.js:31: ERROR - [JSC_PARSE_ERROR] Parse error. '(' expected
31| testArray = [];
^
1 error(s), 0 warning(s)
If I comment that line out the compile works.
here's the whole class:
class TestA
{
testArray = []; // Comment this out to get rid of error
constructor()
{
this.testArray.push( { name : "joe", age : 70 } );
this.testArray.push( { name : "mike", age : 50 } );
this.testArray.push( { name : "bob", age : 33 } );
}
testLoop()
{
for(const test of this.testArray)
{
console.log(" >>> " + test.name + " " + test.age);
}
}
}
Why isn't it compiling properly?