Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #27969
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail |
|---|---|
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: Differences between [[Class]] and constructor |
| Date | Tue, 02 Jun 2015 23:07:46 +0200 |
| Organization | PointedEars Software (PES) |
| Lines | 20 |
| Message-ID | <1528792.TAupHRCX4z@PointedEars.de> (permalink) |
| References | <ct69cmFtvojU1@mid.uni-berlin.de> <6733032.WIyCHQfpTH@PointedEars.de> |
| Reply-To | Thomas 'PointedEars' Lahn <cljs@PointedEars.de> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="UTF-8" |
| Content-Transfer-Encoding | 8Bit |
| X-Trace | solani.org 1433279429 31266 eJwFwQkBwDAIADFLZXxFDrCdfwlLXENi08LDHIe7dCI0S75lVz9MydEz9XAGxFcrWy2sf0R7EgI= (2 Jun 2015 21:10:29 GMT) |
| X-Complaints-To | abuse@news.solani.org |
| NNTP-Posting-Date | Tue, 2 Jun 2015 21:10:29 +0000 (UTC) |
| User-Agent | KNode/4.14.2 |
| X-User-ID | eJwNy8EBwCAIA8CVQBKQcRRk/xHa+x/N1SvgdHA4dff0XfK2RL0RMWBkQyLROuVRxOnROJFsxTp/rtf0tLz2AV1SFWs= |
| Cancel-Lock | sha1:drWwdeOZliqOkYXbrvNySgo0vkE= |
| X-NNTP-Posting-Host | eJwFwYEBwCAIA7CXENsyzhGR/09Ywq2lGxAFDgeYzeiTNUx//VnYKQNQVEclL3v5WOYLZ/0ZEBDd |
| Xref | csiph.com comp.lang.javascript:27969 |
Show key headers only | View raw
Thomas 'PointedEars' Lahn wrote:
> Stefan Ram wrote:
>> function className( object )
>> { return 0,
>> Object.prototype.toString.call( object ).
>> replace( "\[object ", "" ).replace( "\]", "" ); }
>
> This is written shorter, less error-prone, more efficient, and actually
> readable
>
> (({}).toString.call(object).match(/\[object\s+(.+)\s*\]/) || [])[0]
[1], of course. (So much for “less error-prone” ;-))
--
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: Differences between [[Class]] and constructor Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-06-02 22:58 +0200 Re: Differences between [[Class]] and constructor Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-06-02 23:07 +0200
csiph-web