Variable scope is the part of the program from where the variable is directly accessible. In This article we will talk about JavaScript variable scope. In this article you will…