Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

minus function

function minus(a, b) {
  if (b === undefined) return -a;
  else return a - b;
}

console.log(minus(10));
// → -10
console.log(minus(10, 5));
// → 5
Comment

PREVIOUS NEXT
Code Example
Javascript :: module imports renaming 
Javascript :: ngx chart how to use in angular 
Javascript :: javascript quotes 
Javascript :: import local js file node 
Javascript :: jquery target all the li element using jquery 
Javascript :: react show more component 
Javascript :: React Native - iOS Release build crashing 
Javascript :: Captalize all words first letter javascript 
Javascript :: mdn javascript array 
Javascript :: dayofyear mongodb 
Javascript :: what does the symbol function do in javascript 
Javascript :: square brackets javascript object key 
Javascript :: on submit success jquery 
Javascript :: How to sum to small numbers 
Javascript :: PostManDocs 
Javascript :: How to Loop Through an Array with a do…while Loop in JavaScript 
Javascript :: Backbone Model Validation And Inheritance 
Javascript :: how to close bootstrap modal after save 
Javascript :: simple JSX example 
Javascript :: react native long form keyboard awaire 
Javascript :: var date = new Date(); 
Javascript :: flutter webview javascript 
Javascript :: higher order function javascript 
Javascript :: how to nested schema mongoose 
Javascript :: switch statement javascript 
Javascript :: react native get screen height and width 
Javascript :: javascript prefill form 
Javascript :: js add obj prop dynamically 
Javascript :: JavaScript, numbers are primitive data types 
Javascript :: js tilda 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =