← 모든 태그

#javascript

48개의 노트

Garbage collection in JavaScript

The JavaScript engine uses automatic garbage collection. JavaScript automatically manages memory by freeing up space used by objects no longer needed....

dev

What are Explicit binding in JavaScript

Explicit binding is a way to explicitly state what the `this` keyword is going to be bound to using `call`, `apply` or `bind` methods of a function.

dev

What are Heap and Stack in JavaScript

The Heap and Stack in JavaScript Engine are two different data structures that store data in different ways.

dev

What are Scopes in JavaScript

A scope is a set of variables, objects, and functions that you have access to. There are three types of scopes in JavaScript. Which are Global Scope, ...

dev

What is a closure in JavaScript

A closure is a function that has access to its outer function scope even after the outer function has returned. This means a closure can remember and ...

dev

What is a JavaScript promise

A Promise in JavaScript represents a value that may not be available yet but will be at some point. Promises provide a way to handle asynchronous oper...

dev

What is callback hell in JavaScript

**Callback hell**, often referred to as **Pyramid of Doom**, describes a situation in JavaScript where multiple nested callbacks become difficult to m...

dev

What is DOM

The Document Object Model (DOM) is a programming interface for HTML and XML documents. It represents the page so that programs can change the document...

dev

What is Event Capturing in JavaScript

Event capturing is the first phase of event propagation. In this phase, the event is captured by the outermost element and propagated to the inner ele...

dev

What is Event Loop in JavaScript

The Event loop is one the most important aspect to understand in JavaScript. It is the mechanism that allows JavaScript to perform non-blocking operat...

dev

What is Hoisting in JavaScript

Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope before code execution. This means tha...

dev

What is Inheritance in JavaScript

Inheritance is a way to create a new `Class` from an existing `Class`. The new `Class` inherits all the properties and methods from the existing `Clas...

dev

What is JavaScript

JavaScript (often abbreviated as JS) is a high-level, versatile, and widely-used programming language primarily known for its role in web development....

dev

What is Prototype Chain in JavaScript

The prototype chain in JavaScript refers to the chain of objects linked by their prototypes. When a property or method is accessed on an object, JavaS...

dev

What is Type Casting

Type conversion (or typecasting) means transfer of data from one data type to another. Implicit conversion happens when the compiler (for compiled lan...

dev

Does Arrow functions have their own `this`

No, arrow functions do not have their own `this`. Instead, they inherit the `this` of the enclosing lexical scope.

dev

How does Event Loop work in JavaScript

The Event loop has two main components: the Call stack and the Callback queue.

dev

Is it possible to run 2 lines of code at the same time in JavaScript

No, it is not possible to run 2 lines of code at the same time in JavaScript. JavaScript is a single-threaded language, which means that it can only e...

dev

Is it possible to run JavaScript outside the browser

Yes, it is possible to run JavaScript outside the browser. There are several ways to run JavaScript outside the browser. You can use **Node.js**, **De...

dev

Is JavaScript a compiled or interpreted language

JavaScript is an interpreted language. This means that the JavaScript code is not compiled before it is executed. Instead, the JavaScript engine inter...

dev

What is Node.js

Node.js is an open-source and cross-platform JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O...

dev

What is REPL in Node.js

REPL stands for Read-Eval-Print-Loop. It is an interactive shell that allows you to execute JavaScript code and view the output immediately. It is use...

dev

Can you access the DOM in Node.js

No, you cannot access the DOM in Node.js because it does not have a DOM. It is a server-side runtime for JavaScript, so it does not have access to the...

dev

How Node.js handle errors

There are four fundamental strategies to report errors in Node.js:

dev

Hydration

Hydration is the process of using client-side JavaScript to add interactivity to the markup generated by the server. When you use server-side renderin...

dev

Pure Components

Pure components re-render only when the props passed to the component changes. For example, if you have a pure child component inside a parent compone...

dev

ref forwarding

By default, each component’s DOM nodes are private. However, sometimes it’s useful to expose a DOM node to the parent—for example, to allow focusing i...

dev

Synthetic Events

React differs from HTML in that it uses a synthetic event system instead of directly binding to the browser’s native events. This system brings consis...

dev

What is a React

React, is an open-source JavaScript library for building user interfaces (UIs). It was developed and is maintained by Meta, and is widely used by deve...

dev

Bundle-splitting

When building a modern web application, bundlers such as

dev

Compression

> Compress your JavaScript and keep an eye on your chunk sizes for optimal performance. Overly high JavaScript bundle granularity can help with dedupl...

dev

Dynamic-import

In our chat application, we have four key components: `UserInfo`,

dev

Import-on-interaction

> tl;dr: lazy-load non-critical resources when a user interacts with UI requiring it

dev

Import-on-visibility

Besides user interaction, we often have components that aren't visible on the initial page. A good example of this is lazy loading images that aren't ...

dev

Loading-sequence

**Note:** This article is heavily influenced by insights from the

dev

Prefetch

Prefetch is a browser optimization which allows us to fetch resources that may be needed for subsequent routes or pages before they are needed

dev

Preload

Preload is a browser optimization that allows critical resources (that may be discovered late) to be requested earlier

dev

Prpl

Making our applications globally accessible can be a challenge! We have to make sure the application is performant on low-end devices and in regions w...

dev

Third-party

> tl;dr: Third-party resources can slow down sites and can be a challenge to optimize. You can follow certain best practices to load or delay differen...

dev

Tree-shaking

It can happen that we add code to our bundle that isn't used anywhere in our application. This piece of dead code can be eliminated in order to reduce...

dev

Virtual-lists

In this guide, we will discuss list virtualization (also known as

dev

Does Arrow Functions Have Their Own `this`

No, arrow functions do not have their own `this`. Instead, they inherit the `this` of the enclosing lexical scope.

dev

How Does Event Loop Work In JavaScript

The Event loop has two main components: the Call stack and the Callback queue.

dev

Is JavaScript A Compiled Or Interpreted Language

JavaScript is an interpreted language. This means that the JavaScript code is not compiled before it is executed. Instead, the JavaScript engine inter...

dev

Is It Possible To Run 2 Lines Of Code At The Same Time In JavaScript

No, it is not possible to run 2 lines of code at the same time in JavaScript. JavaScript is a single-threaded language, which means that it can only e...

dev

Is It Possible To Run JavaScript Outside The Browser

Yes, it is possible to run JavaScript outside the browser. There are several ways to run JavaScript outside the browser. You can use **Node.js**, **De...

dev

Can You Access The DOM In Node.js

No, you cannot access the DOM in Node.js because it does not have a DOM. It is a server-side runtime for JavaScript, so it does not have access to the...

dev

How Node.js Handle Errors

There are four fundamental strategies to report errors in Node.js:

dev