Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

skip arguments in js

function userInfo(firstName, lastName, userName){
  // other logic stuff
    console.log(firstName, lastName, userName);
}
// skip lastName argument using: ...[,] and it's mean undefine
// 1 argument for ...[,] 2 arguments for ...[,,] and so on.....
userInfo('JavaScript', ...[,], 'js');
//it's mean => firstName: JavaScript, lastName: undefined, userName: js
Comment

PREVIOUS NEXT
Code Example
Javascript :: foreach modify array javascript 
Javascript :: next js build command 
Javascript :: how to check request method was a get 
Javascript :: from string to number js 
Javascript :: import svg as react component 
Javascript :: sequelize migration set unique constraint 
Javascript :: new variable in loop javascript 
Javascript :: create angular component using cli 
Javascript :: loop an audio javascript 
Javascript :: json object check if key exists java 
Javascript :: Vue minify images 
Javascript :: dynamic calendar in javascript with example 
Javascript :: comparing two arrays in javascript 
Javascript :: jquery: get checkbox from each row of the table and select it 
Javascript :: jquery download 
Javascript :: js get english alphabet 
Javascript :: node.js name of file 
Javascript :: javascript array to string with comma 
Javascript :: Xpath select Parent Node Based On Child Node 
Javascript :: first N elements of an array javascript 
Javascript :: javascript unselect radio 
Javascript :: how to print in a same line in javascript 
Javascript :: momentjs 
Javascript :: jquery clone row 
Javascript :: javascritp canvas 
Javascript :: remove first and last element from array javascript and seprated by comma 
Javascript :: disable button in angular 
Javascript :: compare two dates and sort array of objects 
Javascript :: print page using js 
Javascript :: react native "modalize" above bottom navigation 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =