Javascript Array splice and slice method explanation with examples

Array splice() and slice() methods look similar, but both are different and used for different use cases. These methods are most commonly used array methods. In this tutorial, we will learn both of these methods with different examples for each.

Read

How to add and delete last and first elements in a JavaScript array

Javascript provides us a lot of different methods to manipulate array elements. Almost in any development project, we use arrays. Normally, it is required to read/update or delete any intermediate element of an array. For accessing any element in an array, we can use its index. But for adding and removing the first and the last element of an array, javascript provides us a few useful methods.

Read

Find all elements in an array which are greater than other right elements

In this tutorial, we will learn how to find all elements in an integer array which are bigger than all other elements present to the right.

Read

C program to find the sum of A.P. series

A.P. or arithmetic progression series is a sequence of numbers in which each number is the sum of the preceding two numbers. For example, 2, 3, 5, 8, 13... is an A.P. or arithmetic progression series.

Read

C program to reverse an user provided number

In this tutorial, we will learn how to reverse a number in C. Our program will take one number as input from the user, reverse it and print it out.

Read

How to find the duplicate elements in an array in linear time

In this tutorial, we will learn how to find out the duplicate numbers in an array of positive integers in linear amount of time. This is one of the most commonly asked interview question. The array is given and its elements are in the range of 0 to array size - 1. i.e. for an array of size 4, its elements can be any one of 0, 1, 2 and 3. Elements can repeat and we need to find that.

Read

How to use pod try to test an iOS library

Using a third-party library may break an existing project if it is not properly tested. Again, for UI components, it is really hard to choose the perfect one. There are a lot of libraries available for any types of UI like a button or a dialogue.

Read

How to find the remainder in swift using modulo

In this tutorial, we will learn how to find the remainder in swift. Swift provides one operator % to find out the remainder. Let's check how it works :.

Read

Swift program to check if a number is a multiple of another

We can check if a number is multiple of another number or not easily by division. If we divide the first number by the second number and if the remainder is 0, the second number is a multiple of the first number. But, swift also provides one method called isMultiple that we can use to find out if a number is multiple of another number or not. In this tutorial, we will learn how to use this method.

Read

Trim a string in Dart : Explanation with examples

Trim a string means removing the extra white spaces at the end of the string or at the start of the string. Trim is really useful if you don't want that extra white space. If you are comparing one string value in your application with a value you are getting from the server, it will be a problem if the server is sending strings with leading or trailing white spaces. For example,if you are comparing "hello" in your application with a string you will get from the server and if the server sends "hello ", the comparison may fail if you are not removing the trailing blank spaces.

Read