Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

rest parameters javascript

/*The rest parameter syntax allows a function to accept an indefinite
number of arguments as an array, */

function getFirstElementOfArray(...args){
  return args[1]
}

getFirstElementOfArray("shirshak","Sabtech","Javascript")// return shirshak
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #rest #parameters #javascript
ADD COMMENT
Topic
Name
7+1 =