---
title: "Discussion on \"Learn the basics of variable scope in javascript\" | Hashnode"
description: "Discussion on \"Learn the basics of variable scope in javascript\". In javascript, there are three types of scope: global, function, and block. \nPrior to ES6, javascript only had global and function scope, so let's start with those two examples. \nFunction Scope\nWhen a function is created that function creates its own..."
url: "https://hashnode.com/posts/learn-the-basics-of-variable-scope-in-javascript/62e52081430bd1d04a8412ad"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Learn the basics of variable scope in javascript](https://garyditsch.hashnode.dev/learn-the-basics-of-variable-scope-in-javascript?utm_source=hashnode&utm_medium=feed)

In javascript, there are three types of scope: global, function, and block. Prior to ES6, javascript only had global and function scope, so let's start with those two examples. Function Scope When a function is created that function creates its own...

Jul 30, 2022 · 3 min read · garyditsch.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Gary Ditsch](https://hashnode.com/@garyditsch)

@garyditsch

  
[View profile](https://hashnode.com/@garyditsch)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
