Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

function x(a) vs function x(...a) the difference

function x(a)
{console.log(a[0]);
/*for a= ['b','c','d']  a[0] will be b*/
}
function x(...a)
{
console.log(a[0]);
/*for a= ['b','c','d']  a[0] will be ['b','c','d'] to get b you will need a[0][0]*/
/*in second case, the first array has only one term: the a array itself*/
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript get next month name 
Javascript :: Creating Multiple Methods From A List Of Words 
Javascript :: phaser max size of group or pool 
Javascript :: short-circuit evaluation , use of || operator 
Javascript :: Using <template in Javascript to create a form 
Javascript :: get longi and long with an adress react 
Javascript :: Creating getLastBlock Object for blockchain 
Javascript :: javascript find prime numbers 
Javascript :: Staircase 
Javascript :: ngx chart how to use in angular 
Javascript :: sol.common.MapTable elo 
Javascript :: adding amplify in index.js react native 
Javascript :: how to display unicode in javascript 
Javascript :: cubing timer 
Javascript :: what does the symbol function do in javascript 
Javascript :: returning the outliers javascript array 
Javascript :: function titleCase 2 
Javascript :: Control a progress bar for custom video player 
Javascript :: How to Loop Through an Array with a While Loop in JavaScript 
Javascript :: Backbone Collection 
Javascript :: Backbone Router Notes 
Javascript :: add even javascript 
Javascript :: nested object in javascript 
Javascript :: how to check the validation of time in react datetime 
Javascript :: js 
Javascript :: react component did mount function 
Javascript :: angular cli command to create component without spec 
Javascript :: react native get screen height and width 
Javascript :: react native file pdf to base64 
Javascript :: useScrollPrecent 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =