Crenox

Javascript Tutorial For Beginners LearnCode.academy #1

Jun 26th, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. JavaScript is what gives your website functionality.
  2.  
  3. You create variables in JS by saying "var x = 1", right there we made a variable called "x" equal to 1.
  4.  
  5. There's a function in JavaScript called "alert()" where whatever you put there a message dialog shows up on your screen and outputs it.
  6.  
  7. There are several data types in Javscript, similar to all other programming languages.
  8.  
  9. Number: var x = 1
  10. String: var x = "1"
  11.  
  12. There's another function called "prompt()", which asks for the user to input something in a dialog that shows up on the screen.
  13.  
  14. 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.
  15.  
  16. You can also do, "var name = prompt("What is your first name?")"
  17.  
  18. Also, JavaScript ends each line with a semicolon ";"
Add Comment
Please, Sign In to add comment