function memoize(fn) {
			var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

			//======================================================
			// Many thanks to @ConorO'Brien for allowing me to use.
			// The file this is used from is located here:
			// https://github.com/ConorOBrien-Foxx/ffuncs/blob/master/backend/memoize.js
			// github profile located here:
			// https://github.com/ConorOBrien-Foxx
			//======================================================
			var func = fn.bind(context);
			var mem = new Map();
			return rename(function () {
				for (var _len6 = arguments.length, args = Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
					args[_key6] = arguments[_key6];
				}

				return !mem.has(args.join(',')) && mem.set(args.join(','), func.apply(undefined, args)), mem.get(args.join(','));
			}, fn.name);
		}
/**
   * Caches the result. Should only be used on pure functions, which return the same result for the same input.
   * @param {Function} fn The function to cache.
   * @param {Object} [context=null] The context to operate in.
   * @returns {Function} The resulting function.
   * @memberof XtraUtils.Function.
   */
Caches the result. Should only be used on pure functions, which return the same result for the same input.
@param {Function} fn The function to cache.
@param {Object} [context=null] The context to operate in.
@returns {Function} The resulting function.
Caches the result . Should only be used on pure functions which return the same result for the same input . @param { Function } fn The function to cache . @param { Object } [ context = null ] The context to operate in . @returns { Function } The resulting function .
function memoize(fn) {
			var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
			var func = fn.bind(context);
			var mem = new Map();
			return rename(function () {
				for (var _len6 = arguments.length, args = Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
					args[_key6] = arguments[_key6];
				}
				return !mem.has(args.join(',')) && mem.set(args.join(','), func.apply(undefined, args)), mem.get(args.join(','));
			}, fn.name);
		}
function memoize ( fn ) { var context = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : null ; var func = fn . bind ( context ) ; var mem = new Map ( ) ; return rename ( function ( ) { for ( var _len6 = arguments . length , args = Array ( _len6 ) , _key6 = 0 ; _key6 < _len6 ; _key6 ++ ) { args [ _key6 ] = arguments [ _key6 ] ; } return ! mem . has ( args . join ( ',' ) ) && mem . set ( args . join ( ',' ) , func . apply ( undefined , args ) ) , mem . get ( args . join ( ',' ) ) ; } , fn . name ) ; }
Caches the result.
Caches the result .
//====================================================== // Many thanks to @ConorO'Brien for allowing me to use. // The file this is used from is located here: // https://github.com/ConorOBrien-Foxx/ffuncs/blob/master/backend/memoize.js // github profile located here: // https://github.com/ConorOBrien-Foxx //======================================================