MCPcopy Create free account
hub / github.com/marijnh/Eloquent-JavaScript / constructorName

Function constructorName

src/run_tests.mjs:135–139  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

133}
134
135function constructorName(obj) {
136 if (!obj.constructor) return null
137 let m = String(obj.constructor).match(/^function\s*([^\s(]+)/)
138 if (m && m[1] != "Object") return m[1]
139}
140
141function hop(obj, prop) {
142 return Object.prototype.hasOwnProperty.call(obj, prop)

Callers 1

representSimpleObjFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected