Can someone explain why the variable catAge is not recognized as a number (despite not being a string?) and instead concatenates to return 52 instead of 7? I am new to programming and would appreciate any assistance!
var petAge = 5;
var catAge = prompt("Please enter your cat's age:");
// Unexpected result
alert(catAge + 2);
// Corrected version
alert(parseInt(catAge) + 2);