JavaScript Tutorial in Hindi #32: Local and Global Scope in JavaScript in Hindi | JavaScript Scope

Поділитися
Вставка
  • Опубліковано 31 тра 2018
  • Welcome all, we will see Local and Global Scope in JavaScript in Hindi local variable and global variable in javascript.scope in javascript in Hindi.
    Scope determines the accessibility (visibility) of variables.
    JavaScript Function Scope
    In JavaScript there are two types of scope:
    Local scope
    Global scope
    JavaScript has function scope: Each function creates a new scope.
    Scope determines the accessibility (visibility) of these variables.
    Variables defined inside a function are not accessible (visible) from outside the function.
    Local JavaScript Variables
    Variables declared within a JavaScript function, become LOCAL to the function.
    Local variables have local scope: They can only be accessed within the function.
    Since local variables are only recognized inside their functions, variables with the same name can be used in different functions.
    Local variables are created when a function starts, and deleted when the function is completed.
    Global JavaScript Variables
    A variable declared outside a function, becomes GLOBAL.
    A global variable has global scope: All scripts and functions on a web page can access it.
    JavaScript Variables
    In JavaScript, objects and functions are also variables.
    Scope determines the accessibility of variables, objects, and functions from different parts of the code.
    Automatically Global
    If you assign a value to a variable that has not been declared, it will automatically become a GLOBAL variable.
    The Lifetime of JavaScript Variables
    The lifetime of a JavaScript variable starts when it is declared.
    Local variables are deleted when the function is completed.
    In a web browser, global variables are deleted when you close the browser window (or tab), but remain available to new pages loaded into the same window.
    Guys, Please support my channel by SUBSCRIBE to my channel and share my videos in your Social Network TimeLines.
    Don't Forget to Follow me on all Social Network,
    Instagram Link: / vinodthapa55
    Facebook Link: / vinodthapa55
    Twitter Link: / vb55thapa
    Facebook ThapaTechnical Page Link: / vinodbahadurthapa

КОМЕНТАРІ • 9

  • @Sanjeev8880
    @Sanjeev8880 3 роки тому

    Thanx bro... Video is very helpful

  • @imsagar3541
    @imsagar3541 3 роки тому

    Thanks for awesome JavaScript tutorial

  • @SyalSahab
    @SyalSahab 3 роки тому

    5:30 ki hassi sahi thi yrr

  • @sachinrathore4115
    @sachinrathore4115 6 років тому

    Super smart Bhai

  • @thebishalpaul
    @thebishalpaul 3 роки тому

    the playlist need to be organised. Very clumsy.

  • @bestprosenjit
    @bestprosenjit 6 років тому

    sir plz upload angular 5 full tutorial

  • @ertugrulswag6237
    @ertugrulswag6237 3 роки тому

    Please add this tutorial in playlist javascript ..after 31?

  • @emptyvoice7613
    @emptyvoice7613 6 років тому

    tutorial good but starting sound it's not good

  • @gauravrawat8801
    @gauravrawat8801 5 років тому

    Bhai line no. 42 me realname nhi chala hai balki jo function me line no. 47 hai vo realname chala hai.
    Please watch again from 11:30.