FastTrack JavaScript : 01. Variables
by creativevilla
JavaScript
// @Author: Samrat
// @version: 1.0
// @Topic: Variables
// Rules to create variables names
// 1. Start with character or $ (dollar) or _ (underscore)
// 2. Variables are case sensative: variable 'Name' is different than variable 'name'
// 3. Variable name can contain letters(upper/lower), numbers, $ (dollar) and _ (underscore)
// 4. Don't use reserve keywords as variable name (throws error)
// List: http://www.ecma-international.org/ecma-262/5.1/#sec-7.6.1
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Reserved_Words
// Declare and Initialise variable
// Declare
var varName;
// Initialise
varName = "My first variable";
// Also can do declaration and initialisation at same time
var str = "This is string";
// Tip: Always use camelcase while declaring variable.
// Example: var newVariable
// Capitalise the letter which come after space. (Dont capitalise first letter)
// Excercise
// 1. name
// 2. dog
// 3. Alpha
// 4. $Work
// 5. Anonymous
// 6. _temp
// 7. nav
// 8. @imp
// 9. jackSparrow
// 10. continue
// 11. For
// 12. bird
// 13. santro
// 14. Name
// 15. new
// 16. superHero
// 17. 3dots
// 18. table
// 19. %temp
// 20. error
// 21. Error
// 22. $$name
// 23. tajMahal
// 24. Maze
// 25. tube33Light
// 26. liTlEsUnShInE
// 27. ___proto___
// 28. AS3
// 29. coffeeCup
// 30. Integer
// 31. 4Square
// 32. chair
// 33. easterEggs
// 34. PROTO
// 35. Array
// 36. moBile
// 37. strings
// 38. Strings
// 39. String
// 40. door3Bell4
// 41. [array]
// 42. Return
// 43. ^valid
// 44. home
// 45. enter
// 46. delete
// 47. end
// 48. tab
// 49. shift
// 50. xoxo
// 51. mONDAY
// 52. OO00OO
// 53. O0O0O0
// 54. 00ooOO
// 55. TROY
// 56. pop
// 57. unshift
// 58. button
// 59. RightLeft
// 60. length
// 61. Scope
// 62. prototype
// 63. inherit
// 64. exceed
// 65. #FF00FF
// 66. RGBA
// 67. hasOwnProperty
// 68. pin
// 69. extract
// 70. walkingDEAD
// 71. sky_is_blue
// 72. A#aA#a
// 73. shadow
// 74. shuffle
// 75. reverse
//...