I am starting a new mini series on JavaScript. I’m starting it from zero. Anyone can start learning from here. My goal is helping others while learning! I know about JavaScript and I’m working on a MERN tech stack. But I think it is not a bad idea to revise the JavaScript from scratch and helping others in this time. If you have any questions, shoot on the comment session or you can directly ask me in my social media. Social media links are in the last part of today’s lesson! Let’s learn JavaScript together.

More About Variables — JavaScript Series — Part 7

A full series to learn the JavaScript from zero

Muhammad Ali
3 min readJan 24, 2020

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

We can’t start variable name with symbol. Like –

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

But you can start a variable with _ & $

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 –

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

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

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

Do you learn some new stuff today ?

Originally it published on nerdjfpb blog. Check the git for codes.

you can connect with me in twitter, linkedin or instagram

--

--

Muhammad Ali
Muhammad Ali

Written by Muhammad Ali

An otaku who loves computer. Love to write and help others through my work. Have a look on my Instagram https://www.instagram.com/nerd_jfpb/

No responses yet