TypeScript optional, nullable, and default parameters

These features enable you to write more flexible and robust code by allowing for the possibility of "undefined" or "null" values, and by providing default values when no value is passed in.

May 09, 2023#typescript#how-to

How to check if string contains substring in JavaScript

You can use either .includes(), .indexOf(), .search(), .match(), regular expressions, or 3rd-party libraries to check if string contains substring.

May 02, 2023#javascript#how-to

The differences between "var" and "let" in JavaScript

In JavaScript, there are two types of variable declarations: "var" and "let". Both keywords are used to declare variables, but they have some key differences in their behavior and scope.

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 remove elements from array in JavaScript

There are several ways to remove elements from an array, each with its own advantages and disadvantages. It's generally recommended to use the splice() or filter() method.

Apr 25, 2023#javascript#arrays

How to parse and format a date in JavaScript

By parsing and formatting dates in JavaScript, you can ensure that your apps handle dates consistently and accurately, regardless of where the date comes from or how it is displayed.

Apr 24, 2023#javascript#dates

How to filter unique items of an array in Swift

If you don’t care about the order, you can use a Set or Dictionary to remove any duplicates, and then convert it back to an array.

Top 10 Vector Databases & Libraries in 2024

A vector database is a type of database that stores data as high-dimensional vectors, which are mathematical representations of features or attributes.

Apr 13, 2023#AI#ML#DB

Swift KeyPath vs #keyPath()

Swift key paths are a way of storing uninvoked references to properties, which is a fancy way of saying they refer to a property itself rather than to that property’s value.

Apr 07, 2023#swift

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