All Downloads are FREE. Search and download functionalities are using the official Maven repository.

js.RT.extend.js Maven / Gradle / Ivy

The newest version!


	/**
	 * http://stackoverflow.com/questions/12317003/something-like-jquery-extend-but-standalone
	 */
	RT.extend = function(target, source) {
		target = target || {};
		for (var prop in source) {
			if (source[prop] instanceof Array) {
				//Overwrite arrays
				target[prop] = source[prop];
			} if (typeof source[prop] === 'object') {
				target[prop] = RT.extend(target[prop], source[prop]);
			} else {
				target[prop] = source[prop];
			}
		}
		return target;
	};




© 2015 - 2025 Weber Informatics LLC | Privacy Policy