Monthly Archive May 2018

Bynayakdillip

How to Reverse an Array

The reverse() method reverses the elements in an array.
Syntax:arrayName.reverse()

Example:-

var programming = ["c#", "c","java","apex"];
var programmingReverseOrder = programming.reverse();
alert(programmingReverseOrder);

it will be print like
apex,java,c,c#

Bynayakdillip

How to join or combine two arrays to one array?

JavaScript Array concat() Method

it returns combine of records from two arrays.

Example:-

var programming = ["c#", "c","java","apex"];
var dataBaseRelated = ["SQL", "SOQL", "MySQL"];
var application = programming.concat(dataBaseRelated);
alert(application);

It will print like this
c#,c,java,apex,SQL,SOQL,MySQL