Home
<!DOCTYPE html> <html> <body> <h1>Demo: Hoisting</h1> <script> try { Add(5, 5); // error var Add = function Sum(val1, val2) { return val1 + val2; } } catch(ex) { alert(ex); } </script> </body> </html>
Result: