๐งช ECMAScript 2024 (ES15): JS Features
#js #es #es2024 #es15 #withResolvers #groupBy #temporal #tuples #decorators
โ Article link
#js #es #es2024 #es15 #withResolvers #groupBy #temporal #tuples #decorators
ECMAScript 2024 (ES15) is just around the corner, arriving in June 2024. This new version brings many exciting features that promise to simplify your JavaScript code and boost your productivity โ giving you even more time to relax! Letโs dive into five of the most impactful additions.
โ Article link
Hello team! As promised, here is a custom smiley pack for the channel that will decorate the articles.
๐ ๐ โ๏ธ ๐ญ โ๏ธ ๐ โ๏ธ ๐
พ๏ธ ๐
๐ฉท โค๏ธ ๐ ๐ ๐ฉต ๐ ๐ค ๐ฉถ ๐ค
๐ค โค๏ธโ๐ฅ โค๏ธโ๐ฉน โฃ๏ธ ๐ ๐ ๐ ๐ ๐
๐ฏ ๐ โฆ๏ธ ๐ โ โ๏ธ โ๏ธ โ๏ธ โ๏ธ
โข๏ธ โฃ๏ธ ๐ด ๐ณ ๐ถ ๐๏ธ ๐ธ ๐บ ๐ท๏ธ
๐ซ ๐ข โจ๏ธ ๐ท ๐ฏ ๐ณ ๐ฑ ๐ ๐ต
โ โ โผ๏ธ โ๏ธ ๐
๐ ใฝ๏ธ โ ๏ธ ๐ธ
๐ฑ โ๏ธ ๐ฐ โป๏ธ โ
๐ฏ๏ธ ๐น โ๏ธ โณ๏ธ
You can thank us at the link below:
๐ต PayPal: luckystudydanit@gmail.com
๐ต SWIFT code: UNJSUAUKXXX
You can thank us at the link below:
๐ต PayPal: luckystudydanit@gmail.com
๐ต SWIFT code: UNJSUAUKXXX
Please open Telegram to view this post
VIEW IN TELEGRAM
๐4โค1๐ฅ1
#angular #let
The @let operator allows you to define and assign variables directly within your Angular templates. This can help streamline your code, especially when working with asynchronous data. One of the biggest advantages is that it allows you to use the async pipe without worrying about unsubscribing from observables manually.
โ Article link
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
๐2โค1
#js #patterns
Pub/Sub, which means Publish-Subscribe, uses a more structured approach. Instead of depending on DOM components, it uses a central message bus, similar to an events message board. Here is the summary:
- Publishers: These are the event announcers who broadcast messages (events) via the messaging bus.
- Subscribers: These are the visitors who registered to receive specific announcements (events). When a relevant interaction comes, subscribers get notified and can take action.
โ Article link
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
๐2
#js #interview #promise
Problem: Implement a simple version of Promise:
The Promise object is an asynchronous programming solution for handling asynchronous events. Promise objects can represent the status of an asynchronous operation, including:
- pending
- fulfilled
- rejected
Analysis:
๐ถThe MyPromise class is a custom Promise class whose constructor accepts an executor function as a parameter.
๐ฝThe executor function in the constructor will be executed immediately and accepts two parameters, resolve and reject, which are used to modify the state of the Promise.
๐The resolve method is used to modify the Promiseโs status from โpendingโ to โfulfilledโ and pass the value to subsequent handlers.
๐ฅThe reject method is used to modify the Promiseโs status from โpendingโ to โrejectedโ and pass the reason to the subsequent handler.
๐ณThe then method is used to register a callback function to be executed when the Promise is completed or rejected. It accepts two parameters: onFulfilled and onRejected, which are called when the Promise is completed or rejected respectively.
๐ฅฉThe then method returns a new MyPromise instance to support chained calls. If onFulfilled or onRejected returns a value, it will be used as the resolved value for the next MyPromise instance.
๐The catch method is the shorthand form of then(null, onRejected).
๐The isFulfilled method is used to check whether the Promise is in the fulfilled state.
๐ฎThe isRejected method is used to check whether the Promise is in the rejected state.
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
๐4
#angular #signals #computed #effect
Computed Signals: Derived Signal
Function: Computed signals represent values derived from other signals. Think of them as formulas that take existing signals as inputs and produce a new output value.
Creation: You define them using the computed function, specifying a derivation function that outlines how the computed value is calculated.
Benefits:
Lazy Evaluation: Computed signals are calculated only when their value is needed. This avoids unnecessary computations.
Memoization: Subsequent reads of the computed signal with the same dependencies return the cached value, improving performance.
Dependency Tracking: Angular automatically tracks which signals a computed signal depends on. When any of those signals change, the computed signal is automatically recalculated.
Effects: Actions Triggered by Signal Changes
Function: Effects are functions that execute in response to changes in signals. They typically perform side effects like logging, interacting with external APIs, or updating local storage.
Creation: You create effects using the effect function. This function can optionally accept a onCleanup function for managing long-running operations.
Benefits:
Reactivity: Effects automatically run whenever their dependent signals change, ensuring your application stays up-to-date.
Asynchronous Execution: Effects run asynchronously during change detection, preventing them from blocking the main thread.
โ Article link
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
โค1
Glory to Heroes.
Please open Telegram to view this post
VIEW IN TELEGRAM
๐10๐1
This media is not supported in your browser
VIEW IN TELEGRAM
#js #interview #eventLoop
Question: Give an explanatory note on the event loop mechanism.
answer:
The event loop mechanism mainly has the following processes:
๐Synchronous tasks are executed on the main thread, forming an execution context stack.
๐Once all synchronous tasks in the execution stack have been executed, the system will read the asynchronous tasks in the queue, such as Promise.then(), setTimeout, AJAX callbacks, etc.
๐The asynchronous task will be added to the task queue
๐ฅOnce the execution stack is cleared, the system checks the task queue. If it is not empty, the first task is taken out and placed on the execution stack for execution.
๐ฅฆThe main thread repeats the process of alternating execution of the stack and queue, thereby realizing queued execution of threads.
The event loop allows synchronous tasks and asynchronous tasks to be executed alternately in the same thread, making full use of CPU resources. This is important for JavaScript that supports UI interaction and responsiveness.
Please open Telegram to view this post
VIEW IN TELEGRAM
โค1๐1
๐ต FOR Ukraine:
๐ https://send.monobank.ua/jar/6DbLp37hre
๐ณ 5375 4112 1187 1350
๐ FOR ALL DONATS:
๐ต PayPal: luckystudydanit@gmail.com
๐ต SWIFT code: UNJSUAUKXXX
My profile with reports after closing fundraiser :
https://www.facebook.com/volunt2erua/
also all reports in our๐ channel:
https://t.me/toxicc_squad
๐ https://send.monobank.ua/jar/6DbLp37hre
๐ณ 5375 4112 1187 1350
๐ FOR ALL DONATS:
๐ต PayPal: luckystudydanit@gmail.com
๐ต SWIFT code: UNJSUAUKXXX
My profile with reports after closing fundraiser :
https://www.facebook.com/volunt2erua/
also all reports in our
https://t.me/toxicc_squad
Please open Telegram to view this post
VIEW IN TELEGRAM
โค3