Introspecção em JavaScript

<!DOCTYPE html><html><head><title>JavaScript Introspection</title></head><body><script>var x;function introspect(object){var type = Object.prototype.toString.call(object);switch(type){case ‘[object Array]’:x = “array”;break;case ‘[object Object]’:x = “object”;break;case ‘[object String]’:x = “string”;break;case ‘[object Number]’:x = “number”;break;case ‘[object Boolean]’:x= “boolean”;break;case ‘[object Date]’:x= “date”;break;case …

Continuar lendo