Error handling with Async/Await in JS
This will be a small article, based on some issues I picked up during code reviews and discussions with other developers. This article is rather focused on the novice JS developers.
A Simple Try Catch
Let’s start with the simple try...catch example.
function thisThrows() {
throw new Error("Thrown from thisThrows()");
}
try {
thisThrows();
} catch (e) {
console.error(e);
} finally {
console.log('We do cleanup here');
}
// Output:
// Error: Thrown from thisThrows()
// ...stacktrace
//...
далее...
Achieve Typescript mastery with a 21-steps guide, that takes you from Padawan to Obi-Wan.
Content
Intro
Best Practice 1: Strict Type Checking
Best Practice 2: Type Inference
Best Practice 3: Linters
Best Practice 4: Interfaces
Best Practice 5: Type Aliases
Best Practice 6: Using Tuples
Best Practice...
далее...
print media queries
Вы можете стилизировать версию вашего сайта для печати с помощью media query:
@media print {
* {
background-color: transparent;
color: #000 ;
box-shadow: none;
text-shadow: none;
}
}
gradient text
h1 {
background-image: linear-gradient(to right, #C6FFDD, #FBD786, #f7797d);
background-clip: text;
color: transparent;
}
Улучшаем media defaults
Когда пишите css reset файлик, добавьте настройки для мультимедийных файлов:
img, picture, video, svg {
max-width: 100%;
object-fit: contain; /* preserve a nice aspect-ratio */
}
column count
Создаем column лейауты с...
далее...
Backend frameworks are the most critical building blocks that make application development easier and practical. Most developers, and clients for whom the developers create apps, have a problem choosing a backed framework. For a long time, .NET has played a crucial role as the go-to framework to develop the core elements of the apps.
On the other hand, front-end frameworks are the pioneering blocks that define how the user will interact...
далее...
Why do we need lifecycle hooks?
Modern front-end frameworks move the application from state to state. Data fuels these updates. These technologies interact with the data which in turn transitions the state. With every state change, there are many specific moments where certain assets become available.
At one instance the template might be ready, in another data will have finished uploading. Coding for each instance requires a means of detection. Lifecycle hooks...
далее...
Let’s start the battle TypeScript vs JavaScript with an introduction of both technologies. JavaScript is a scripting language, that was developed by EMCA’s Technical Committee and Brendan Eich. It works perfectly in web-browsers without the help of any web-server or a compiler. It allows you to change HTML and CSS in the browsers without a full page reload. That is why it is used to create dynamic and interactive web...
далее...
Quick Summary: - Frontend frameworks are the pioneer blocks of the software development process. But there are so many options to choose when it comes to building visually appealing apps that rank high on user experience. To help you out, we have curated a list of the best frontend frameworks of 2020 for you. Let's check them out!
User experience is the number one priority for every business in the...
далее...