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>”);