Discuss the below:
Q: The following two programs differ in that one uses parseFloat and the other does not. What will be the output from each program if the user inputs 4 followed by 2?
Give your reasons.
Program 1
var first;
var second;
first = window.prompt('Enter a digit','0');
second = window.prompt('Enter a second
digit','0');
document.write(first + second);
Program 2
var first;
var second;
first = window.prompt('Enter a digit','0');
second = window.prompt('Enter a second
digit','0');
first = parseFloat(first);
second = parseFloat(second);
document.write(first + second);