JS Assignment 10: Array Properties and Methods
skudeva (10)

Hi everyone,

I am completely lost! I can't figure out exercise 1.

https://repl.it/student/submissions/6952500

function exerciseOne(classmates){
// Exercise One: You will be given an array called 'classmates'
// Create a variable called 'howManyStudents', and assign it to
// the length of the classmates array (using the length property)

var howManyStudents=(classmates);
classmates.lenght;
consol.log(classmates.lenght);

You are viewing a single comment. View All
heyitsmarcus (282)

Hey @skudeva,

We meet again! haha You are so close with what you have. What you want to do is assign the value of classmates.length to howManyStudents and you can do that on the line with var howManyStudents like this:

function exerciseOne(classmates){
    // Exercise One: You will be given an array called 'classmates'
    // Create a variable called 'howManyStudents', and assign it to
    // the length of the classmates array (using the length property)

    var howManyStudents = classmates.length;
    console.log(howManyStudents);
}

Now, the variable howManyStudents will contain the number of elements in the classmates array passed into the function exerciseOne!

If this answer solved your problem, please consider upvoting and choosing my answer as the accepted answer.

skudeva (10)

@heyitsmarcus I really appreciate your help! Thanks again :D!

heyitsmarcus (282)

@skudeva No worries! Happy Coding! :)

JwalyaOza (3)

@skudeva. buddy i'm feeling really very ashamed to let you know that ONCE AGAIN i'm facing some extremely silly yet complicated quarries in solving the js assignment 10 please it's my humble request to you to find me the correct way of typing the answers. though i forgot to tell you that i Actually got able to get what exactly they want me to write but the problem is... that i'm not getting the suitable way/method of typing it which can enable be to pass it. so with hope of getting help from you just like how you have been doing since assignment 8,9 i expect you to help me this time as well i hope you would try to understand and help your online course buddy which is me.. please find me the correct answers in order to finish the assignment so that i can move ahead