Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- JavaScript is what gives your website functionality.
- You create variables in JS by saying "var x = 1", right there we made a variable called "x" equal to 1.
- There's a function in JavaScript called "alert()" where whatever you put there a message dialog shows up on your screen and outputs it.
- There are several data types in Javscript, similar to all other programming languages.
- Number: var x = 1
- String: var x = "1"
- There's another function called "prompt()", which asks for the user to input something in a dialog that shows up on the screen.
- So for example, if I were to do "var name = prompt()", it would ask you to input something and whatever you put would be stored as name.
- You can also do, "var name = prompt("What is your first name?")"
- Also, JavaScript ends each line with a semicolon ";"
Add Comment
Please, Sign In to add comment