DEV Community

Cover image for More About Variables – JavaScript Series – Part 7
Muhammad Ali (Nerdjfpb)
Muhammad Ali (Nerdjfpb)

Posted on • Originally published at blog.nerdjfpb.com

More About Variables – JavaScript Series – Part 7

In last part we learned about variables right ? Now today we are going to learn a bit more about variables.

Alt Text

We can't start variable name with symbol. Like -

Alt Text

Variable can start with a letter than numbers, it's fine. But no way to start numbers

Alt Text

But you can start a variable with _ & $

Alt Text

We can't have space in variable name and if we need a long variable name. Then we use camelCase. Which means you'll write in big letter the second word. example -

Alt Text

Let do a little easy trick with variable. First we'll get two variable and add them and store it on a new variable, then we'll see if we got the exact value

Alt Text

Another thing, we can change the types of variable just by storing that value on there, like -

Alt Text

What if we didn't mention any type while initialing a variable. It will be undefined. This is another type of JS, we didn't learn at first. If you never initialize a variable but trying to call it, then it will give you a reference error

Alt Text

Do you learn some new stuff today ?

You can see the graphical version here

Source Codes - { Check commits }

GitHub logo nerdjfpb / javaScript-Series

A tutorial for JavaScript Beginners

javaScript-Series

A tutorial for Absolute Beginners of JavaScript.

You can find the total pdf in - Here

You can check the commits to find the part by part codes.

Blogs

Day 1
  • Day 1 - What is JavaScript?
Day 2
  • Day 2 - JavaScript Types?
Day 3
  • Day 3 - Javascript Types Cont.
Day 4
  • Day 4 - Javascript Types Cont.
Day 5
  • Day 5 - Javascript Comparisons
Day 6
  • Day 6 - Javascript Variables
Day 7
  • Day 7 - More About Variables
Day 8
  • Day 8 - Conditional Statement
Day 9
  • Day 9 - More Conditional Statement
Day 10
Day 11
Day 12
Day 13
Day 14
Day 15
Day 16
Day 17

Originally it published on nerdjfpbblog. You can connect with me in twitter or linkedin !

Top comments (0)