Advanced Javascript Concepts-3

JavaScriptCallback Functions

A callback function is a function passed into
another function as an argument, which is
then invoked inside the outer function to
complete some kind of routine or action.

Async/Await And Promises

Software developers use async to define an
asynchronous function. These are perfect for
involving many iterations, such as fetching
data from an API or reading a file from a disk.
Asynchronous functions will automatically
return a promise, but you can pause their
execution using the await keyword. This way,
the function will wait for some other promises
to resolve. That can improve readability and
error handling.

Functional Programming:

Functional programming (FP) has gained
significant traction in the world of software
development, and JavaScript developers are
increasingly turning to this paradigm to solve
problems more efficiently and with fewer bugs.
At its core, functional programming
emphasizes the use of pure functions,
immutability, and advanced techniques like
currying, memoization, and monads to create
cleaner, more predictable code.

Memoization

Memoization is a technique for speeding up
applications by caching the results of
expensive function calls and returning them
when the same inputs are used again.

this Keyword:

In JavaScript, the this keyword refers to the
current execution context or the object that a
function is a method of. The value of this is
determined by how a function is called.
Understanding this is crucial for writing
object-oriented and functional JavaScript
code.

Composition

Composition means to Compose. Everything in
JavaScript is treated as an object even
functions in JavaScript are treated as a high-
class object. Such objects are quite complex in
nature to make large complex objects simple,
many small objects are composed together.