Skip to main content Skip to docs navigation

Local Variable

A variable whose name is bound to its value only within a local scope .

On this page

Local variable

Example

js
                                        
                                            let
                                            global =
                                            5
                                            ;
                                            // A global variable
                                            function
                                            fun
                                            (
                                            )
                                            {
                                            let
                                            local =
                                            10
                                            ;
                                            // A local variable
                                            }
                                        
                                    

See also

Updated on April 20, 2024 by Datarist.