DEV Community

Hihi
Hihi

Posted on

My notes on Javascript functions and related things.

I write some writeup thoughts while learning on frontendmaster.

Execution context

When a function is invoked, keep in mind that that function will attach to 2 things:

  • thread: the ability to run the code in the function from top to the bottom;
  • local memory: where the function saves their local variables & inner reference values. That 2 things is called execution context.

Block scope

Only the functions can create its own execution context, other code block, loops,... don't create.
So all the variables and values once involved in that function will be locked in and can't be accessed outside.

Closure

The ability of accessing values from outer scope. To deeply understand closure you should have a notion of what execution context is.

Higher order function

HOF is an idea of passing function as an argument to another function. This concept give us an idea of freely modification make our code more reusable.

AWS Q Developer image

Your AI Code Assistant

Implement features, document your code, or refactor your projects.
Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay