Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

true type of javascript

function trueTypeOf(element) {
  const regex = /[object |[]]/g;
  const prototypeString = Object.prototype.toString.call(element); // returns [object Type]

  return prototypeString.replace(regex, "");
}
 
PREVIOUS NEXT
Tagged: #true #type #javascript
ADD COMMENT
Topic
Name
5+5 =