Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

10.4.2. Functions // Default Value

/*This example modifies the hello function to use a default value for 
name. If name is not defined when hello is called, it will use the 
default value.*/

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

console.log(hello());
console.log(hello("Lamar"));

//Hello, World!
//Hello, Lamar!
Comment

10.4.2. Functions // Default Value


function read_file(file, delete_after = false) {
  // Code
}

Comment

PREVIOUS NEXT
Code Example
Javascript :: js object to jspn 
Javascript :: movie-trailer usage 
Javascript :: custom http vue 2 
Javascript :: react-image-lightbox npm 
Javascript :: check before element jquery 
Javascript :: how array sort works internally in javascript 
Javascript :: how to check if an image exists in js from cross origin 
Javascript :: iterating hashmap angular 
Javascript :: jquery set focus on first input which is not readonly 
Javascript :: javascript Ecrire une fonction afficherTable2() qui affiche la table de multiplication de 2 dans le contenu d’un élément p. 
Javascript :: how to send address of mathods call of solidaty in node 
Javascript :: javascript options documentation 
Javascript :: react.children.toarray explained 
Javascript :: get user input javascript 
Javascript :: vscode autosuggest background 
Javascript :: javascript make the web browser scroll to the top 
Javascript :: fat arrow return object 
Javascript :: JAVASCRPITMAMA 
Javascript :: blank array condition in react js 
Javascript :: es6-map-an-array-of-objects-to-return-an-array-of-objects-with-new-keys 
Javascript :: petShopIndex.html:137 Uncaught ReferenceError: $ is not defined jquery node 
Javascript :: Get value from ionRangeSlider in jquery 
Javascript :: react native controlling device brightness 
Javascript :: node equivalent of bash exec 
Javascript :: mapa gratis leaflet 
Javascript :: how to pass function arguments without invoke the function 
Javascript :: what regular express will match valid internation number 
Javascript :: how to style elements that had ben added with inner html js 
Javascript :: Literal string with a variable inserted 
Javascript :: how presist state in nuxt.js 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =