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

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 (288)

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 (21)

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

heyitsmarcus (288)

@skudeva No worries! Happy Coding! :)

JwalyaOza (3)

@heyitsmarcus. Sir very ashamed to admit but i am really having a hard time in completing the js assignment 10 and i need proper guidance from you in order to finish the assignment as quick as possible and move on to the next one. i could solve the first exercise but ain't able solve the remaining ones and i have been stuck on this from last 4 days so it will be good if you help me

heyitsmarcus (288)

@JwalyaOza I am afraid I don't know this exercise. Copy and paste what code you have and what the problem is, and I can help you better!

JwalyaOza (3)

@heyitsmarcus. Well sir exercise 2 and 3 are the one where I am not able find the correct answer and sorry sir for being very late I was engaged at some other important study related stuff but now I am back and yes. If you will help me to sort out this problem of me being stuck at exercise 2 and 3 of 10th assignment of JavaScript them I would be very thankful to you sir so I hope you can help me

JwalyaOza (3)

@heyitsmarcus. Well sir exercise 2 and 3 are the one where I am not able find the correct answer and sorry sir for being very late I was engaged at some other important study related stuff but now I am back and yes. If you will help me to sort out this problem of me being stuck at exercise 2 and 3 of 10th assignment of JavaScript them I would be very thankful to you sir so I hope you can help me

heyitsmarcus (288)

@JwalyaOza You will have to copy and paste the problem and then copy and paste your code to each problem.