How to use type hints in Python

Type hints don't enforce type checking at runtime, but they provide valuable information for static type checkers, code completion, and code clarity for developers.

Jan 03, 2024#python#types

Difference between *args and **kwargs in Python

In summary *args collects the extra positional arguments as a tuple, while **kwargs collects the extra keyword arguments as a dictionary.

Jan 02, 2024#python#functions

Mastering recursive functions in JavaScript

A recursive function typically has a base case that stops the recursion and one or more recursive cases that call the function itself.

How to run shell commands in Python

Python can be used to automate various tasks, and sometimes these tasks involve interacting with the underlying operating system.

Dec 17, 2023#python#shells

Check if a variable is list in Python

This verification is essential for ensuring that the subsequent operations or functions are appropriate for the data structure at hand.

Dec 16, 2023#python#lists

When are anonymous functions useful in JavaScript

Anonymous functions are commonly used in IIFEs (Immediately Invoked Function Expressions), callbacks, closures, event handlers, etc.

How to redirect to new URL in JavaScript

For simple redirections without the need for advanced routing features, using vanilla JavaScript is often sufficient.

Dec 13, 2023#javascript#webdev

How to use tuple type hints in Python

Python 3.8 and earlier require importing `Tuple` from the `typing` module. Python 3.9+ allows using `tuple` directly without importing.

Dec 12, 2023#python#tuples

How to perform string interpolation in Python

You can use the % operator, format method, or f-strings to perform string interpolation, which is inserting values into a string in Python.

Dec 08, 2023#python#strings

How to send an authorization header with Axios

Axios has some useful features, such as setting default headers, intercepting requests and responses, canceling requests, and transforming request and response data.

Dec 05, 2023#axios#node#http