Not Sure Why I'm getting NaN on this code
Trying to solve this ES6 Class Methods Practice Problem and this is my code so far: You are making a program so that students are able to calculate their average of 3 exam scores. The given program takes the scores of 3 exams as input and declares the Exams class. Add a static method average() to class Exams, which will take the scores as parameters, and calculate and return the average score rounded to the nearest integer so that the code in main works correctly. function main() { var exam1 = parseInt(readLine(), 10); var exam2 = parseInt(readLine(), 10); var exam3 = parseInt(readLine(), 10); console.log(Exams.average(exam1,exam2,exam3)); } class Exams{ //your code goes here constructor(x,y,z) { this.x = x; this.y = y; this.z = z; } static average(a) { const avg = ((a.x + a.y + a.z)/3); return Math.round(avg); }; }; I'm just a little confused as to why the function is returning NaN when I run it.