Javascript function to get the difference between two numbers
snippet in javascript

Javascript function to get the difference between two numbers

user9723

var difference = function (a, b) { return Math.abs(a - b); }

Javascript function to get the difference between two numbers

user5312

function foo(num1 , num2) {
   return Math.abs(num1-num2);
} 

Javascript function to get the difference between two numbers

user3770

function difference(n, m){
    return Math.abs(n - m)
}

Javascript function to get the difference between two numbers

user2253

var difference = function (a, b) { return Math.abs(a - b); }