Answer to the questions ( JavaScript) , please

JavaScript:

Explain the following JavaScript code. What will the output be?

var multipleValues = [50, 80, 100];
console.log (multipleValues.length);
var len = multipleValues.length;
for (x=0; x < len; x++)
{console.log(multipleValues);}
var reverseValues = multipleValues.reverse();
var rlen = reverseValues.length;
for (x=0; x < rlen; x++)
{console.log(reverseValues);}


Explain the following JavaScript code. What will the output be?

var valueOne = “15”;
var valueTwo = “30”;
var vo = vt = 0;

vo = parseInt(valueOne);
vt = parseInt(valueTwo);

document.writeln("<p>The first number is " + vo + ", the second is "

  • vt + “.</p>”);

var result1 = valueOne + valueTwo;
document.writeln("<p>The value for result1 is "

  • result1 + “</p>”);

result2 = vo + vt;
document.writeln("<p> The value for result2 is " +
result2 + “</p>”);

Hi,

Welcome to the forums!

This looks remarkably like an assignment, so I would be surprised if anyone gives you the answers outright.
Why don’t you try and work out the answers yourself and post back here if you get stuck.