Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

10.4.3. Arguments Are Optional // Functions

/*Just as it is possible to call a function with fewer arguments than it 
has parameters, we can also call a function with more arguments than it 
has parameters. In this case, such parameters are not available as a 
named variable.

This example calls hello with two arguments, even though it is defined 
with only one parameter.*/

function hello(name = "World") {
   return `Hello, ${name}!`;
}

console.log(hello("Jim", "McKelvey"));
Comment

PREVIOUS NEXT
Code Example
Javascript :: check before element jquery 
Javascript :: how to replace all words in javascript in hindi 
Javascript :: scroll down react js typescript 
Javascript :: how to detect keyboard layout js 
Javascript :: %20find%20all%20docs%20that%20have%20at%20least%20two%20name%20array%20elements_ 
Javascript :: iterating hashmap angular 
Javascript :: The attribute name of [ *ngFor ] must be in lowercase.(attr-lowercase) in VSCode 
Javascript :: react native getting older version assets 
Javascript :: remove 0 from 01 
Javascript :: route edit button in laravel ajax 
Javascript :: t_networkless_options":true,"disable_signout_supex_users":true,"desktop_adjust_touch_target":true,"kevlar picker ajax 
Javascript :: alegato termino excluido 
Javascript :: change event when click multiple revit api 
Javascript :: change background color js tinymce 
Javascript :: Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout. 
Javascript :: add multiple classes javascript 
Javascript :: contentful rte edit link type 
Javascript :: how to show numbers in javascript using while loop 
Javascript :: react native expo PayloadTooLargeError: request entity too large 
Javascript :: convert to arrow functions 
Javascript :: runjs 
Javascript :: how to reaload a tab in js 
Javascript :: jquery override page title 
Javascript :: <xsl:apply-templates select node text subnodes all 
Javascript :: como saber si un afecha es mayor o menor js 
Javascript :: react google login button size increase 
Javascript :: javascript map set shorthand 
Javascript :: giving an html element own attribute js 
Javascript :: how to revert parse date in javascript 
Javascript :: javascript escape comma in csv 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =