Javascript Number jitter( amount )

Description

Javascript Number jitter( amount )


"use strict";//  w w  w.  j a  v  a  2s . c  o  m


Number.prototype.jitter = function( amount ) {

  var jitter = ( Math.random() * 2 - 1 ) * amount; 

  return this + jitter;
}



PreviousNext

Related