Menu

Post image 1
Post image 2
1 / 2
0

JavaScript

DEV Community: beginners·Vairavan·4 days ago
#X0YedB6N
#dev#fullscreen#console#enter#exit#article
Reading 0:00
15s threshold

JavaScript is one of the most popular programming languages in web development. It is mainly used to make websites interactive and dynamic. With JavaScript, we can create things like buttons, animations, calculators, login forms, games, and much more. Variables Variables used to store data in JavaScript. JavaScript has 3 ways to create variables: var let const var var has global scope and it is the old way of declaring variables. var a = 10 ; console . log ( a ); output : 10 Enter fullscreen mode Exit fullscreen mode let let has block scope. It can only be accessed inside { }. Example: let a = 10 ; { let a = 20 ; console . log ( a ); // 20 } console . log ( a ); // 10 OutPut : 10 Enter fullscreen mode Exit fullscreen mode const const is used for constant values. Its value cannot be reassigned. const c = 30 ; console .…

Continue reading — create a free account

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

Read More