#arrays

Found 13 articles tagged with #arrays

Different ways to loop through an array in C

There are several ways to loop through an array in C, and the choice often depends on the specific requirements of your program.

Feb 10, 2024#c#arrays

How to use destructuring assignment in JavaScript

A feature in JavaScript that allows you to extract values from objects or arrays and assign them to variables in a more concise and readable way.

What is array-like object in JavaScript

An object that has numeric indices and a length property.

How to clear an array in JavaScript

When you say "clear the array" in the context of programming, it generally means removing all the elements from the array, leaving it empty.

Jan 16, 2024#javascript#arrays

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 convert an object to an array in JavaScript

Whether you need to extract keys, values, or key-value pairs, Object.keys(), Object.values(), and Object.entries(), each serving a unique purpose in converting objects into arrays.

Difference between tuples and arrays in TypeScript

Tuples can store only a fixed number of elements and types at each index, while arrays can store any combination of types and the order is not important.

How to declare array type in TypeScript

Arrays in TypeScript are very similar to JavaScript arrays, but TypeScript provides you with the power of static typing, type inference, and type annotations.

Rotate Array

The problem is about rotating an array to the right by a given number of steps, modify the given array in-place (without using an extra array) and perform the rotation.