Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added hyperlinks to eachscope #240

Merged
merged 4 commits into from
Oct 8, 2024
Merged

added hyperlinks to eachscope #240

merged 4 commits into from
Oct 8, 2024

Conversation

hemangtk
Copy link
Contributor

@hemangtk hemangtk commented Oct 8, 2024

Fixes #239.

Copy link

vercel bot commented Oct 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
learn-javascript ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 8, 2024 8:23pm

Copy link
Owner

@sumn2u sumn2u left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your approach is on the right track, but it should be closer to the example below. We won’t be adding ###, as it represents a third-level heading, which isn’t suitable here. Additionally, the current changes would result in duplicate content.

Screenshot 2024-10-08 at 3 09 37 PM

Suggest changes:

There are three types of scopes in JS:

- [Global Scope](#global-scope)
- [Local or Function Scope](#function-scope)
- [Block Scope](#block-scope)

<a id="global-scope"></a>
**Global Scope**: Variables or functions declared in the global namespace have global scope, which means all the variables and functions having global scope can be accessed from anywhere inside the code.
 .....

<a id="function-scope"></a>
**Function Scope**: Any variables or functions declared inside a function have `local/function scope`, which means that all the variables and functions declared inside a function, can be accessed from within the function and not outside of it.
....

<a id="block-scope"></a>
**Block Scope**: `Block scope` is related to the variables declared using let and const. Variables declared with var do not have block scope. Block scope tells us that any variable declared inside a block `{ }`, can be accessed only inside that block and cannot be accessed outside of it.

Copy link
Owner

@sumn2u sumn2u left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice Work!

@hemangtk
Copy link
Contributor Author

hemangtk commented Oct 8, 2024

@sumn2u please do check it
i have made the necessary changes

@sumn2u sumn2u merged commit e9b20c2 into sumn2u:main Oct 8, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Navigation of scope to respective section
2 participants