Sign Up

Lists

Twidget offers a variety of commands to help you manipulate lists easily without coding. Below is a detailed explanation of each command available.

Get

Description: Returns the element in the provided list at the given index.

Inputs:

  • list: The list from which to get the element.

  • index: The index of the element to return.

Output: The element at the given index in the list.

First

Description: Returns the first element of the provided list.

Inputs:

  • list: The list from which to get the first element.

Output: The first element of the list.

Last

Description: Returns the last element of the provided list.

Inputs:

  • list: The list from which to get the last element.

Output: The last element of the list.

Add

Description: Adds the provided item to the end of the provided list.

Inputs:

  • list: The list to which the item will be added.

  • item: The item to be added to the list.

Output: The number indicating the new size of the list.

Insert

Description: Inserts the provided item at the given index in the provided list.

Inputs:

  • list: The list to which the item will be inserted.

  • item: The item to be inserted.

  • index: The index at which to insert the item.

Output: The number indicating the new size of the list.

Add All

Description: Adds all of the elements in the second provided list to the end of the first provided list.

Inputs:

  • list_1: The list to which elements will be added.

  • list_2: The list containing elements to be added to list_1.

Output: None.

Remove by Index

Description: Removes the element at the given index from the provided list.

Inputs:

  • list: The list from which an item will be removed.

  • index: The index of the item to be removed.

Output: The modified list after removal.

Remove by Object

Description: Removes the specified item from the provided list if it exists.

Inputs:

  • list: The list from which an item will be removed.

  • item: The item to be removed.

Output: A boolean indicating whether an item was removed.

Remove All

Description: Removes all elements from the first list that also exist in the second list.

Inputs:

  • list_1: The list from which elements will be removed.

  • list_2: The list containing elements to be removed from list_1.

Output: None.

Index Of

Description: Returns the index of the first occurrence of the specified object in the provided list.

Inputs:

  • list: The list in which to find the item.

  • item: The item to find the index of.

Output: The index of the first occurrence of the item in the list.

Size

Description: Returns the number of elements in the provided list.

Inputs:

  • list: The list whose size will be returned.

Output: The size of the list.

Clear

Description: Removes all elements from the provided list.

Inputs:

  • list: The list to be cleared.

Output: None.

Reverse

Description: Reverses the order of the elements in the provided list.

Inputs:

  • list: The list to be reversed.

Output: A boolean indicating whether the list was successfully reversed.

Shuffle

Description: Randomly shuffles the elements in the provided list.

Inputs:

  • list: The list to be shuffled.

Output: None.

Join

Description: Concatenates all elements of the provided list into a single string using the specified delimiter.

Inputs:

  • list: The list whose elements will be concatenated.

  • delimiter: The delimiter to use between elements.

Output: A string containing all elements of the list separated by the delimiter.

Is Empty

Description: Checks whether the provided list is empty or not.

Inputs:

  • list: The list to check.

Output: A boolean indicating whether the list is empty.

Not Empty

Description: Checks whether the provided list is not empty.

Inputs:

  • list: The list to check.

Output: A boolean indicating whether the list is not empty.

Contains

Description: Checks whether the provided list contains the specified item.

Inputs:

  • list: The list in which to check.

  • item: The item to check for in the list.

Output: A boolean indicating whether the item is in the list.

Related Topics

Variables

Variables are essential building blocks in Twidget that allow you to store and manipulate data dynamically within your no-code applications. They enable you to create flexible and interactive applications by holding values that can be changed and referenced throughout your workflow. Creating Variabl...

Security

Twidget provides several built-in functions to enhance the security of your applications. Below is an overview of each security command, including its description, inputs, and outputs. Generate ID. Description: Generates a unique identifier. None - Type: Text Hash Text. Description: Hashes the provi...

Managing Files

Twidget offers a set of commands to manipulate files in your file store. Below are the descriptions and usage of each command to help you understand how to utilize them effectively. Get File. Retrieve a file via file path. Inputs: - `path`: The file path to retrieve the file from. Outputs: - `filena...

Send External HTTP Request

Using Twidget, you can send external HTTP requests effortlessly. This functionality allows you to communicate with external servers or APIs. Below, you will find the necessary parameters and structure to set up an HTTP request. Parameters. - URL: The endpoint to which the request will be sent. - Met...

Error Handling

When building applications with Twidget, you may encounter situations where you need to handle errors gracefully to ensure your application runs smoothly. Twidget provides two powerful commands for error handling: `try-catch` and `throw-error`. This documentation will guide you on how to use these c...