Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

in js pass infinite argument in function

/*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
Comment

PREVIOUS NEXT
Code Example
Javascript :: for loop in js 
Javascript :: Lazy Loading 
Javascript :: return the first element in an array javascript 
Javascript :: change url without reloading the page 
Javascript :: how to create scroll to top button in reactjs example code 
Javascript :: pass object by value js 
Javascript :: name function in javascript 
Javascript :: gitea 
Javascript :: convert string to integer: 
Javascript :: javascript function expression 
Javascript :: javascript how to select a array 
Javascript :: delegate in javascript 
Javascript :: spotify player react 
Javascript :: where from terminal colors come 
Javascript :: converter rgba to hex without opacity 
Javascript :: input type for mobile number in react js 
Javascript :: js toggle div 
Javascript :: code cat 
Javascript :: discord role giver 
Javascript :: react validate 
Javascript :: id in class selector jquery 
Javascript :: find the second largest number in array javascript 
Javascript :: fixed header on scroll vuejs 
Javascript :: luhn algorithm javascript 
Javascript :: creating a custom function to use nodemailer to send email 
Javascript :: activate router angular 
Javascript :: url 
Javascript :: onClick button react send to another component 
Python :: install matplotlib conda 
Python :: python subtract months from date 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =