Check if object has a specific property in JavaScript

Method hasOwnProperty is often preferred when you want to check only the object itself, while the in operator is useful when you want to check the entire prototype chain.

How to return multiple values in JavaScript

If there are multiple pieces of data that are logically related to each other, it makes sense to group them together and return them as a single unit.

How to capitalize first letter in Swift

Capitalizing first letter of each word, the first letter of a sentence, or all caps lies in the specific style and purpose of text presentation.

Jan 28, 2024#swift#strings

How to add zeros before number in javascript

Adding leading zeros to a number is often necessary in scenarios where the representation of the number needs to have a fixed width or format.

How to reverse a string in JavaScript

You can achieve string reversal using array manipulation methods like split, reverse, and join or through loops and other techniques.

How to shuffle an array in JavaScript

When we talk about "shuffling" an array, it means changing the order of the elements within the array in a random or pseudo-random manner.

Jan 15, 2024#javascript#arrays

How to get last element of an array in JavaScript

One common method is to use the array’s length property and subtract one from it, another method is to use the array’s slice() method with a negative index.

Jan 14, 2024#javascript#arrays

How to create a custom URLSession in Swift

It's important to consider the specific requirements of your tasks and choose the appropriate session type and configuration accordingly.

Jan 06, 2024#swift#network

How to perform migrations in SwiftData

Lightweight migrations are automatic and can handle small changes, complex migrations require manual intervention and can handle more advanced changes.

How to create custom view modifiers in SwiftUI

You can also create your own custom view modifiers by adopting the ViewModifier protocol and implementing the body(content:) method.

Jan 04, 2024#swiftui#modifiers