answersLogoWhite

0

To calculate the four number game in javaScript ..... I assume you are asking how to calculate the total of the 4 numbers?

A simple function calculating the array (assuming you are using an array) is the easiest way.

function calculate(array)

{

var total = 0;

for (var counter = 0; counter < array.length; counter = counter + 1)

{

total = total + array[counter];

}

return total;

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How do you calculate number of four sided figures?

the answer is 16and stop saying these things25


What method g would be increase by four times?

To increase a number by four times, you would multiply the number by 4. For example, if you have the number &quot;g&quot;, to increase it by four times you would calculate 4g.


Can anyone please give funny script for four people?

Men or women?


Calculate the number of protons electrons and neutrons in helium-6?

Helium-6 has two protons and electrons and four neutrons.


Calculate the four types of elasticities by taking the examples from your daily life?

Calculate the four types of elasticities by taking the examples from your daily life. Calculate the four types of elasticities by taking the examples from your daily life.


What are the four primary elements that critics consider when writing a review of a dramatic work?

Set construction, script, director, actors and actresses, theme


How do you calculate the greatest number of four digit which is exactly divisible by 12 16 24 28 and 36?

The integers divisible by those 5 numbers are exactly the multiples of 1008. The largest multiple of 1008 which is still a four-digit number is 9*1008 = 9072.


What are 5 main events in I Am Number Four by pittacus lore?

1. Number four is born. 2. Number four is told he is number four. 3. Number four realizes he is gay and masturbates to Justin Bieber. 4. A book is written about Number four.


What number is after four?

The number after four is five (5)


What is the formula of a parallelogram if one whole side is one number?

To calculate the perimeter, add the four sides. To calculate the area, calculate base x height, where the height must be perpendicular to the base. In any case, you need more than just the length of one side to do the calculations.


What number is after four four two?

The number sequence four four two can also be referred as four hundred and forty two. The number following this would be four four three or four hundred and forty three.


How is a number divisible by four?

If the last two digits of a number are divisible by four, the whole number is divisible by four.