Menu

Post image 1
Post image 2
1 / 2
0

Understanding Variables and Data Types in JavaScript

DEV Community·Abhishek sahni·about 1 month ago
#8sgAKfK4
Reading 0:00
15s threshold

In this blog we are going to learn basic fundamentals of programming. We are exploring variables and datatypes in javascript. First we try to understand variables. So what are variables. Variables : Variables are containers that stores and manage some data. There are three ways to declare a variable in javaScript. let , var and const . syntax to declare a variable : let variableName = value ; Enter fullscreen mode Exit fullscreen mode var variableName = value ; Enter fullscreen mode Exit fullscreen mode const variableName = value ; Enter fullscreen mode Exit fullscreen mode You can use let , var and const according to your use case. What is scope : Scope defines where a variable can be access in program. Global Scope : A variable declared outside any function can be access anywhere in the program. Function Scope : A variable declared inside a function cannot be accessed outside that function. Block Scope : Block scope was introduced in ES6.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More