How can I find the biggest number from the numbers I’ve entered in array?
things i’ve tried already:
var largest = Math.max.apply(Math, number[i]);
var smallest = Math.min.apply(Math, number[i]);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’re very close:
You need to pass all of the elements of the array to the
max()metho;[i]doesn’t make sense here.