Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7737515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:01:10+00:00 2026-06-01T08:01:10+00:00

I was learning through javascript’s context and .apply() and .call() function and am having

  • 0

I was learning through javascript’s context and .apply() and .call() function and am having trouble with one particular statement.

Math.max.apply( Math, array );

can you explain how it works to provide the maximum number??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:01:12+00:00Added an answer on June 1, 2026 at 8:01 am

    apply is a function’s method that calls a the function with the given context object and arguments provided as an array:

    var ops = {
       sum : function (a, b) {
           return a + b;
       }
    }
    
    ops.sum.apply(ops, [4, 6]); // 10
    
    // is equivalent to:
    
    ops.sum(4, 6);
    

    Math.max returns the largest of zero or more numbers:

    Math.max(1,2,3,4); // 4
    

    So, using apply, you have:

    Math.max.apply(Math, [1,2,3,4]); // 4
    

    That is equivalent to the code above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm learning javascript and was going through an example here: https://developer.mozilla.org/en/A_re-introduction_to_JavaScript function personFullName() {
I'm learning JavaScript and while browsing through the jQuery library I see : (colon)
I am learning JavaScript through the Head First series book by O'Reilly media, and
I'm new to JavaScript. I've worked my work through Learning JavaScript (o'reilly) but am
I have a C/C++ programming background, and while casually learning Javascript through the @3C
Doing some javascript self-learning and the program itself is very simple. It searches through
I was just reading through Learning Python by Mark Lutz and came across this
I'm hacking my way through learning Flex and have found some strange behaviour. When
New to wpf and through a learning curve. I have a userControl with a
Through a lot of learning and research, i wrote a server side program. But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.