Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js named parameters

myFunction({ param1 : 70, param2 : 175});

function myFunction({param1, param2}={}){
  // ...function body...
}

// Or with defaults, 
function myFunc({
  name = 'Default user',
  age = 'N/A'
}={}) {
  // ...function body...
}
Comment

named arguments in javascript

function foo({first, second, third} = {}) {
  console.log(first, second, third)
}

foo({
  first: 1,
  second: 2,
  third: 3 
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: open new window chrome extension 
Javascript :: open cypress window 
Javascript :: firestore batch add array 
Javascript :: react useeffect avoid initial render 
Javascript :: route pass props to component 
Javascript :: quine 
Javascript :: regexp object javascript 
Javascript :: convert utc string to date format of mm dd/mm/yyyy in javascript 
Javascript :: how to stop google colab from disconnecting 
Javascript :: trim string after - in jquery 
Javascript :: get all global variables javascript 
Javascript :: datatable child rows without ajax 
Javascript :: electron disable menu 
Javascript :: jquery on click outsile hide div 
Javascript :: get name of class javascript 
Javascript :: classname did not match server next js styled components 
Javascript :: ngswitchcase in angular 8 
Javascript :: async false in ajax 
Javascript :: comprobar si un objeto esta vacio javascript 
Javascript :: simple ajax request 
Javascript :: change span value javascript 
Javascript :: scroll to div js 
Javascript :: nested objects javascript 
Javascript :: add value to each object in array javascript 
Javascript :: Count of positives / sum of negatives 
Javascript :: what is cdn react 
Javascript :: nodejs mysql getting the id of an inserted row 
Javascript :: toast in angular not working 
Javascript :: how to cache data in javascript 
Javascript :: jquery upload image 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =