TypeError: A type error has occurred
You cannot convert a number to upper case:
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> var num = 1;/* www . j a va 2 s . c om*/ try { num.toUpperCase(); } catch(err) { document.getElementById("demo").innerHTML = err.name; } </script> </body> </html>