---
title: "Discussion on \"JavaScript 作用域和閉包\" | Hashnode"
description: "Discussion on \"JavaScript 作用域和閉包\". 關注問題\n\nthis 的不同應用場景，如何取值？\n\n手寫 bind 函數\n\n\n知識點\n\n作用域和自由變量\n\n全局作用域\n\n函數作用域\n\n塊級作用域\n\n\n\n閉包：兩種常見方式 & 自由變量查找規則\n\nthis\n\n\n閉包\n\n作用域應用特殊狀態，有兩種狀況\n\nfunction create() {\n  let a = 100;\n  return function () {\n    console.log(a);\n  };\n}\n\nlet fn = create();\nlet a = 200;\nfn();..."
url: "https://hashnode.com/posts/closure/644385beda73423128104fb1"
---

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

Discussion

# [JavaScript 作用域和閉包](https://emmaswy.hashnode.dev/closure?utm_source=hashnode&utm_medium=feed)

關注問題 this 的不同應用場景，如何取值？ 手寫 bind 函數 知識點 作用域和自由變量 全局作用域 函數作用域 塊級作用域 閉包：兩種常見方式 & 自由變量查找規則 this 閉包 作用域應用特殊狀態，有兩種狀況 function create() { let a = 100; return function () { console.log(a); }; } let fn = create(); let a = 200; fn();...

Apr 22, 2023 · 3 min read · emmaswy.hashnode.dev  
Read the article

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

## Written by

[Emma Shih](https://hashnode.com/@emma163)

@emma163 · Taiwan, Taipei

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

Technical sharing from a FE Developer

ESTJ 前端工程師｜曾經任職乘車服務、電商和區塊鏈公司，走過新加坡，現座標台北｜有一隻很二哈的賓士貓｜樂於探索知識擁抱新工具｜同時也是 Hip Hop 人偶爾跳跳 jazz

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
