JavaScript Tutorial 6 - Variables in JavaScript (var vs let vs const) | Programming For Beginners

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 มิ.ย. 2024
  • JavaScript Tutorial 6 - Variables in Javascript (var vs let vs const) | Programming For Beginners
    In this video by Programming for beginners we will see JavaScript Tutorial 6 - Variables in JavaScript (var vs let vs const)
    JavaScript is a lightweight, cross-platform, single-threaded, and interpreted compiled programming language. JavaScript is the world's most popular programming language and must learn language to become a web developer. You can use JavaScript in frontend and backend technologies as well.
    Variables are Containers for Storing Data
    JavaScript Variables can be declared in 4 ways:
    - Automatically - [var is used internally]
    - Using var - global scope
    - Using let [added in 2015] - block scope
    - Using const [added in 2015] - block scope
    It is a good practice to always declare variables before use.
    When to Use var, let, or const?
    1. Always declare variables
    2. Always use const if the value should not be changed
    3. Always use const if the type should not be changed (Arrays and Objects)
    4. Only use let if you can't use const
    5. Only use var if you MUST support old browsers.
    ==========
    JavaScript Tutorial Playlist:
    • JavaScript Tutorial Fo...
    HTML CSS Projects Playlist:
    • HTML CSS Projects
    Complete CSS Tutorial for Beginners Playlist:
    • CSS Tutorial For Begin...
    Complete HTML Tutorial for Beginners Playlist:
    • HTML Tutorial for Begi...
    Python Programs for Beginners Playlist:
    • Python Programs
    Python Tutorial for Beginners Playlist:
    • Python Tutorial
    Java Tutorial for Beginners Playlist:
    • Java Tutorial
    All Java Programs Playlist:
    • Java Programs
    What is JavaScript ?
    JavaScript is a lightweight, cross-platform, single-threaded, and interpreted compiled programming language. It is also known as the scripting language for webpages. It is well-known for the development of web pages, and many non-browser environments also use it.
    JavaScript is a weakly typed language (dynamically typed). JavaScript can be used for Client-side developments as well as Server-side developments. JavaScript is both an imperative and declarative type of language. JavaScript contains a standard library of objects, like Array, Date, and Math, and a core set of language elements like operators, control structures, and statements.
    - Client-side: It supplies objects to control a browser and its Document Object Model (DOM). Like if client-side extensions allow an application to place elements on an HTML form and respond to user events such as mouse clicks, form input, and page navigation. Useful libraries for the client side are AngularJS, ReactJS, VueJS, and so many others.
    - Server-side: It supplies objects relevant to running JavaScript on a server. For if the server-side extensions allow an application to communicate with a database, and provide continuity of information from one invocation to another of the application, or perform file manipulations on a server. The useful framework which is the most famous these days is node.js.
    - Imperative language - In this type of language we are mostly concerned about how it is to be done. It simply controls the flow of computation. The procedural programming approach, object, oriented approach comes under this as async await we are thinking about what is to be done further after the async call.
    - Declarative programming - In this type of language we are concerned about how it is to be done, basically here logical computation requires. Her main goal is to describe the desired result without direct dictation on how to get it as the arrow function does.
    How to Link JavaScript File in HTML ?
    JavaScript can be added to HTML file in two ways:
    Internal JS: We can add JavaScript directly to our HTML file by writing the code inside the script tag. The script tag can either be placed inside the head or the body tag according to the requirement.
    External JS: We can write JavaScript code in another files having an extension.js and then link this file inside the head tag of the HTML file in which we want to add this code.
    TH-cam Gears:
    Microphone: amzn.to/3iIk5K3
    Mouse: amzn.to/35irmNF
    Laptop: amzn.to/3iG0jyD
    #JavaScriptTutorial #JavaScript #webdevelopment #programmingforbeginners
    ============================
    LIKE | SHARE | COMMENT | SUBSCRIBE
    Thanks for watching :)

ความคิดเห็น •