Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary JavaScript, ISBN: Variables in JavaScript

Rating
-
Sold
-
Pages
1
Uploaded on
04-03-2023
Written in
2022/2023

A JavaScript variable is merely a name for a storage place. Variables in JavaScript are classified as either local or global. When declaring a JavaScript variable, there are several guidelines to follow (also known as identifiers). 1.The name must begin with a letter (a to z or A to Z), underscore (_), or dollar ($) symbol. 2.After the initial letter, we can include digits (0 to 9), for example, value1. 3.JavaScript variables are case sensitive, therefore x and X are separate variables.

Show more Read less
Institution
Course

Content preview

Variables in JavaScript
The first and most important concept in any programming language is variables.
The only tricky point is when you want to store your data for a temporary
purpose. We will be using variables. In this video we are focusing how do you
store data in a code, so we can do that with the help of variables. When you run
this code. Of course, you will get four, four because of the first operation and
the second operation, but don't you think we are doing the same thing again. the
only change is this time. You are fetching the value from a variable, so the first
fold which you got here is coming from this number okay now I can actually
reuse and that's the power right. If you want to create a variable in JavaScript.
You have an option of just by saying a variable name. You can use it by chance.
If you 're coming from other language. Let 's say C++, Java or any language
which needs you to declare variables that's right in some languages. We have to
declare them first here we are simply saying num.


We have a variable username and then we are trying to assign a name and we
got an error. See what this editor says it says Naveen is not defined that’s where
I am defined here see the problem is if you remember we have talked about this
whenever you write a code that code has to be converted into a machine code
because your computer understands only one language which is machine
language. when you want to assign a string always use double quotes, so text
string it should be inside a double quote. JavaScript says you can use both and
that’s why JavaScript is a flexible language in that case, but yeah if you are
using a double quotes at the start don't use single quote at the end, if you're
starting your programming journey, you will be facing a lot of errors as I.
mentioned before that should be a part of your life write a code get others solve
them, which is very important and the first step to solve a error is to read the
error properly.. never use a variable name which is not defining itself and that
means you have you 're declaring multiple times.


numbers are allowed and you can put numbers anywhere not the first value. The
first letter should not be a number. There are certain standards. You can follow
to name your variable so whenever you have variable which has two words.
Example, if you look at this username here, you can see there are two words,
right user and name.




DM

Written for

Institution
Course

Document information

Uploaded on
March 4, 2023
Number of pages
1
Written in
2022/2023
Type
SUMMARY

Subjects

$3.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
dhavalwall05

Get to know the seller

Seller avatar
dhavalwall05 Exam Questions
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 year
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions