I would like to find the type of the Javascipt object (the name of the constructor function), but I just return a generic “object” with all the methods I tried. I searched on the Internet, and no Javascript method that I found yet works for me. It always just returns the constructor type of the object as a generic "object". However, this is the case when looking at me when I test it on the Chrome console. Any ideas on how I can get this information in JS?
PS. I use Browserify to split my code, if that matters.

The reason I thought this might be because Browserify loads the require code, because this is the result that I get from the constructor function loaded via the browser:

And here is what I get from creating the constructor function manually:

Regardless of this and no matter how I create my constructor function var Prey = function() {} vs var Prey = function Prey() {} , Chrome dev tools still seem to know that the constructor function name was even then when javascript doesn't seem to know. Perhaps this is because they can check the code on the virtual machine in such a way that the Javascript language does not have access, but I wonder if I am missing something. Does anyone know of another way to determine instance type in Javascript?
source share