js difference between two numbers

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

Also in JavaScript: