Get type of variable

by Alexey Zakharov

JavaScript

function getType(obj) {
	return {}.toString.call(obj).slice(8, -1);
}
alert(getType([]));