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 7308027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T23:30:05+00:00 2026-05-28T23:30:05+00:00

function ArrayAdditionI(arr) { var numbers = arr(); var arraySum = ; for (var i

  • 0
function ArrayAdditionI(arr) {  
  var numbers = arr();
   var arraySum = "";
   for (var i = 0; i < numbers.length; i++) {
        arraySum = arraySum + arr[i];
};
if (numbers.max() <= arraySum) {
  arr = true
}
else if (numbers.max() > arraySum) {
   arr = false;
}

  return arr;            
} 

I need to find the numbers stored in an array called arr and check if they add up to or total the greatest number or whether they do not. If so, return true. If not, return false.

I am not sure I am calling the array correctly in the beginning.

Thanks

  • 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-05-28T23:30:05+00:00Added an answer on May 28, 2026 at 11:30 pm

    You mean something like this?

    function ArrayAdditionI(arr) {  
    
        for (var i = 0, sum=0; i < arr.length; i++) {
            sum += arr[i];
        }
    
        return Math.max.apply( Math, arr ) <= sum;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

function checkauth(){ jQuery.getJSON(/users/checkauthjson, null, function(xhr){ if(xhr.success){ return true;}else{ return false;} }); } Obviously, that
function countChars(elm) { if (elm.nodeType == 3) { // TEXT_NODE return elm.nodeValue.length; } var
function getLink($sa){ if($sa=='1'){ $sa = 'qp_bbl'; } else { $sa = 'qp_sbl'; } return
function has_thumbnail_image(&$post) { $content = $post->post_content; return preg_match('/<img[^>]+src=(.*?)[^>]*>/', $content, $results); } I need a
function MySingletonClass(arg) { this.arr = []; if ( arguments.callee._singletonInstance ) return arguments.callee._singletonInstance; arguments.callee._singletonInstance =
function test() { var flag1 = false; if ($('#field1').attr('value') || !$('#field1').attr('value')) { $.ajaxSetup({ cache:
function validateRequiredFields(formid) { var inputs = document.getElementsByClassName('required'); for(i=0;i<inputs.length;i++) { var FieldID = inputs[i].id; if(
Function.prototype.bind = function(){ var fn = this, args = Array.prototype.slice.call(arguments), object = args.shift(); return
function getLeftPos(elm){ var left = 0; while(elm){ left += elm.offsetLeft; elm= elm.offsetParent; } return
function getsession(){ var data = $.get('../session', function(data) { return data; }); return data; }

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.