Prev Demo
Javascript Statment Example
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <h1>Statements ends with Semicolon's and function starts and ends with curly braces'{}'</h1> <script> var firstName = "Shanti Shen"; function GetMyName() { return firstName; } // call the function declare above var name = GetMyName(); alert(name); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output