Angular Stream
55 subscribers
21 photos
271 links
Angular news, events, videos etc.
If you want to recommend a post please write @hobbyts911
Download Telegram
Как работает reduce() в JavaScript, когда его нужно применять и какие крутые вещи можно с ним делать

В этой статье вы узнаете про метод reduce() и какие клевые штуки можно вытворять с его помощью, выйдя за рамки его общеизвестного применения.

Читать: https://prglb.ru/4we1

#javascript #core
Поки сидите дома є прекрасна можливість порозв'язувати цікаві задачки. В цьому вам допоможуть ці ресурси (для цього потрібна реєстрація):
1) https://app.codility.com/programmers/lessons/1-iterations/
2) https://www.hackerrank.com/onboarding/challenge
3) https://projecteuler.net/archives

#javascript #practice
Не дуже стикався з потребою динамічного додавання таким чином елементів в Ангулярі, але є такі способи у vanilla js для того щоб сторінка перемалювалась лише один раз:
https://davidwalsh.name/documentfragment
та https://developer.mozilla.org/en-US/docs/Web/API/Range/createContextualFragment #DOM #javascript
Деякі техніки об'єднання масивів https://davidwalsh.name/combining-js-arrays, а також цікавий аналіз по їх продуктивності взятий з коментарів https://jsperf.com/combining-js-arrays/8 #javascript #arrays #tips
🚨 Stop Splitting URLs in #JavaScript the Wrong Way! 🚨

We’ve all been there: You need to work with a URL string, and your first instinct is to use String.split(). Maybe you ended up juggling multiple temporary variables, awkwardly handling query parameters with extra splits and joins, and producing buggy, hard-to-maintain code. 😖 There must be a better way, right? 🤔

Enter the Native URL Constructor

The URL constructor in JavaScript is a game changer! It parses a URL for you and gives you back a structured, easy-to-use object that contains everything you need.

👀 Why Use URL?

Clean and Intuitive: Easy to understand and maintain.

Built-In Validation: Automatically validates and formats your URLs.

Feature-Rich: Handles all parts of the URL (host, protocol, path, query, fragment).

Performance Boost: Native support means less overhead compared to custom string operations.

No more manual string manipulation. Just clean, readable, and bug-free code! 🚀
🔥1