Seeking assistance here as a final resort, I've dedicated over 50 hours trying to resolve this persistent error. Any help would be truly appreciated.
Error: "Decunstructing Assignments are not supported by the current version of Javascript", "Expecting a semicolumn or newline".
Objective: Assign user input within a for loop to variables and utilize those variables to set object properties for each element in the object array.
function STUDENT(name, id, course, mark, sum)
{
this.studName = name;
this.studentID = id;
this.courses = course;
this.marks = mark; //Attempted new array and marks[courses][0]
this.studsum = sum;
}
var student = new Array(30);
for(i = 0; i < 30; i++)
{
var name1 = prompt("Enter Student Name:");
if (name1 !== "!!!")
{
var id1 = parseInt(prompt("input the students ID:", ""));
for (var l = 0; l < course.length; l++)
{
mark1[l] = parseFloat(validateMark(l));
sum1 += mark1[l];
coursesum[l] = mark1[l] + coursesum[l];
}
var student[i] = new STUDENT(name1, id1, course1, mark1, sum1);
/*ERROR IS HERE ^*/
}
else
i = 30; /*Breaks out of loop*/
}/* end of for loop*/
I have explored various options, yet this remains the core of my code; all other functions perform correctly, console.log() displays each variable as expected.
Your guidance is greatly appreciated.