<script>
function person() {
this.sex = "";
this.name = "";
}
var persona = new person();
var a = [];
function getParClsName(cls) {
return cls.constructor.toString().split("()")[0].split(" ")[1];
}
alert("Function name - " + getParClsName(a));
alert("Function name - " + getParClsName(persona));
</script>