#how-to

Found 44 articles tagged with #how-to

How to get response body when using fetch() in JavaScript

The body is not directly accessible as a string or an object, but rather as a stream of data that can only be read once using methods liks json(), text(), blob(), arrayBuffer(), formData().

Apr 28, 2023#javascript#how-to

How to fix error "__dirname is not defined in ES module scope" in Node.js

If you have enabled ES modules in Node.js or using ES modules through a module bundler like Webpack, you'll no longer have access to many variables compared to CommonJS.

Cannot use import statement outside a module in Node.js

This error means that you are trying to use the import statement in a file that is treated as a CommonJS module by Node.js. There are a few ways to fix this error, depending on your preferences and project setup.

When to use currying in JavaScript?

Currying is a technique of working with functions that transforms a function with multiple arguments into a series of functions that each take only one argument.

Apr 21, 2023#javascript#how-to

How to encode and decode JSON data in Swift

With Codable, you can easily convert Swift objects to data representations and vice versa, without having to write complex serialization and deserialization code.

Apr 08, 2023#swift#how-to

5 ways to use `keyof` operator in TypeScript

By using `keyof`, you can define types that depend on the properties of an object without actually knowing the specific property names in advance.

Apr 06, 2023#typescript#how-to

How to Implement Type Erasure in Swift

Type erasure in Swift is a technique that lets you use generic protocols or protocols with associated types as concrete types, by hiding or erasing the specific type information.

Apr 01, 2023#swift#how-to

How to Pass Data Up & Down in SwiftUI

You typically use State and StateObject to hold data as single source of truth, then passing around using binding, custom environment values, or preferences.

Mar 24, 2023#how-to#swiftui

How Senior Developers Sabotage Interviews

We'll explore some reasons why experienced developers may fail in coding interviews, be aware and to take steps to improve, and ultimately increase chances of success.

How to Become a Successful Software Engineer

Ultimately up to the individual to determine what success means, often requires a combination of technical skills, soft skills, and some luck.