<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/javascript-under-the-hood-advanced-concepts-developers-should-know-xrzlgfa-f" -->

---
title: JavaScript Under The Hood: Advanced Concepts Developers...
description: In JavaScript, the scope goes from outer to inner. This means that variables declared in the outer scope can be accessed in all inner scope, not vice versa....
canonical: https://daily.dev/posts/javascript-under-the-hood-advanced-concepts-developers-should-know-xrzlgfa-f
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: JavaScript Under The Hood: Advanced Concepts Developers Should Know | daily.dev
og:description: In JavaScript, the scope goes from outer to inner. This means that variables declared in the outer scope can be accessed in all inner scope, not vice versa....
og:url: https://daily.dev/posts/javascript-under-the-hood-advanced-concepts-developers-should-know-xrzlgfa-f
og:image: https://api.daily.dev/og/posts/xRzlGFA-F.png
og:image:alt: JavaScript Under The Hood: Advanced Concepts Developers Should Know
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# JavaScript Under The Hood: Advanced Concepts Developers Should Know

**[Community Picks](https://daily.dev/sources/community)** · 6 min read · 243 upvotes · 7 comments

## Summary

In JavaScript, the scope goes from outer to inner. This means that variables declared in the outer scope can be accessed in all inner scope, not vice versa. When console.log (sport) was run, it attempted to locate the variable declaration in the favoriteSport function. The external reference point is determined by where your function is lexically positioned. For example, favoriteSport() is Lexically positioned not within function otherSport.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.bitsrc.io/javascript-under-the-hood-advanced-concepts-developers-should-know-a89ddbb11228>

## Community discussion

Top comments from developers on daily.dev.

**@pavlicko** · 1 upvotes

> keep an eye on hoisting and scope chain, easy to get whacked results if you're not careful

**@zataara** · 1 upvotes

> This goes deep into the internal mechanisms of JS! Incredibly enlightening.

**@stefanrows** · 1 upvotes

> Solid article!

**@easymedia** · 1 upvotes

> Nice article.

**@frontendpedia** · 1 upvotes

> Very nice article!

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 1 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments
- [CNCF Unveils Schedule for KubeCon \+ CloudNativeCon Europe 2026](https://daily.dev/posts/cncf-unveils-schedule-for-kubecon-cloudnativecon-europe-2026-ikhcoa5cb) · CNCF · 2 upvotes · 0 comments
- [CNCF Debuts KubeCon \+ CloudNativeCon Japan 2026 Schedule](https://daily.dev/posts/cncf-debuts-kubecon-cloudnativecon-japan-2026-schedule-xp5pyudub) · CNCF · 1 upvotes · 0 comments

---

Tags: [#javascript](https://daily.dev/tags/javascript), [#functional-programming](https://daily.dev/tags/functional-programming)

[View this post on daily.dev](https://daily.dev/posts/javascript-under-the-hood-advanced-concepts-developers-should-know-xrzlgfa-f)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"JavaScript Under The Hood: Advanced Concepts Developers Should Know","url":"https://daily.dev/posts/javascript-under-the-hood-advanced-concepts-developers-should-know-xrzlgfa-f","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/javascript-under-the-hood-advanced-concepts-developers-should-know-xrzlgfa-f"},"datePublished":"2022-11-04T12:18:06.355Z","dateModified":"2023-12-07T12:02:45.284Z","description":"In JavaScript, the scope goes from outer to inner. This means that variables declared in the outer scope can be accessed in all inner scope, not vice versa....","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/40b33c82f6d2d6b6f8b2bb848598c098","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/40b33c82f6d2d6b6f8b2bb848598c098","isAccessibleForFree":true,"articleSection":"Community Picks","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Community Picks","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1655817725/logos/community","url":"https://daily.dev/sources/community"},"commentCount":7,"discussionUrl":"https://daily.dev/posts/javascript-under-the-hood-advanced-concepts-developers-should-know-xrzlgfa-f","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":243},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":7}],"keywords":"javascript,functional-programming","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Community Picks","item":"https://daily.dev/sources/community"},{"@type":"ListItem","position":3,"name":"JavaScript Under The Hood: Advanced Concepts Developers Should Know"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/javascript-under-the-hood-advanced-concepts-developers-should-know-xrzlgfa-f","comment":[{"@type":"Comment","text":"keep an eye on hoisting and scope chain, easy to get whacked results if you’re not careful","datePublished":"2022-11-07T19:01:46.708Z","url":"https://daily.dev/posts/xRzlGFA-F#c-UVdHbra_3","author":{"@type":"Person","name":"David Pavlicko","url":"https://daily.dev/pavlicko","image":"https://avatars.githubusercontent.com/u/5881821?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"This goes deep into the internal mechanisms of JS! Incredibly enlightening.","datePublished":"2022-11-05T04:48:55.441Z","url":"https://daily.dev/posts/xRzlGFA-F#c-WyQKPYXlX","author":{"@type":"Person","name":"Bryant MacMahon","url":"https://daily.dev/zataara","image":"https://avatars.githubusercontent.com/u/75229911?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"Solid article!","datePublished":"2022-11-05T09:58:28.659Z","url":"https://daily.dev/posts/xRzlGFA-F#c-8g3tDXp2i","author":{"@type":"Person","name":"Stefan Rows","url":"https://daily.dev/stefanrows","image":"https://avatars.githubusercontent.com/u/38349705?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"Nice article.","datePublished":"2022-11-06T21:17:46.981Z","url":"https://daily.dev/posts/xRzlGFA-F#c-ETAV3pig3","author":{"@type":"Person","name":"Easy Media","url":"https://daily.dev/easymedia","image":"https://media.daily.dev/image/upload/s--O0TOmw4y--/f_auto/v1715772965/public/noProfile"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"Very nice article!","datePublished":"2022-11-09T09:26:24.527Z","url":"https://daily.dev/posts/xRzlGFA-F#c-CwsrbW2yx","author":{"@type":"Person","name":"Frontendpedia","url":"https://daily.dev/frontendpedia","image":"https://avatars2.githubusercontent.com/u/44444612?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}]}
```

