Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

default in javascript

const greet = (message = 'Hello World!') => console.log(message);

greet(); // prints 'Hello World!'
greet('Hello! Does this answer your question?') // prints 'Hello! Does this answer your question?'
Comment

.default in javascript

function multiply(a, b) {
  b = (typeof b !== 'undefined') ?  b : 1
  return a * b
}

multiply(5, 2)  // 10
multiply(5)     // 5
Comment

default javascript

function say(message='Hi') {
    console.log(message);
}

say(); // 'Hi'
say('Hello') // 'Hello'
Comment

PREVIOUS NEXT
Code Example
Javascript :: code checker javascript 
Javascript :: else in javascript 
Javascript :: what is a blob in javascript 
Javascript :: json generator 
Javascript :: class component params in react 
Javascript :: template literals js 
Javascript :: where is brazil located 
Javascript :: what the cjs.js fiel use 
Javascript :: filter a table based on combibox in js 
Javascript :: react native store sensitive data in redux 
Javascript :: js button to take current page screenshot 
Javascript :: google script getactivescell 
Javascript :: can we send image in json in angular 
Javascript :: recoilOutside npm 
Javascript :: how to print array of 52/ print it 5 times with different value in javascript 
Javascript :: action cable nuxtjs 
Javascript :: build a javascript to easily change website colours theme 
Javascript :: How to Delete Comment from Post on Node, express and Mongoose and Ajax 
Javascript :: The Scratch Semicolon Glitch 
Javascript :: Expressions 
Javascript :: js query first instance 
Javascript :: adding preview images to react apps for linkedin 
Javascript :: angular absolute routerlink 
Javascript :: javascript vererbung Klasse extends super constructor 
Javascript :: page slug vuejs 
Javascript :: jwtdecode has no call signatures angular 
Javascript :: react actions sintaxe 
Javascript :: array of in javascript 
Javascript :: configure column menu in kendo grid angular to hae only locked 
Javascript :: fnserverparams aodata push custom filter 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =