Path: csiph.com!xmission!news.glorb.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!Xl.tags.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.westnet.com.au!news.westnet.com.au.POSTED!not-for-mail NNTP-Posting-Date: Sat, 19 Dec 2015 00:05:14 -0600 Subject: Re: Element output in JavaScript consoles Newsgroups: comp.lang.javascript References: From: RobG Date: Sat, 19 Dec 2015 16:05:10 +1000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 45 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 58.6.210.146 X-Trace: sv3-evXLGsw0NliIW2EA4wUJ993sZT3Bfb17/ybqYnMkLu1xgB8+rUl+pr0jowtj3qf0c1dN4xHSrCSxfwN!aCQVwx6BmnKZcByRitkKBenBxi4xlYPVX78qEb5Ihfh99A17iYV1Z1q7XemJKk+Lv1zN5jd9bh32!vcFXlZzrQ/ATmnWbhf8= X-Complaints-To: abuse@westnet.com.au X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2286 X-Received-Bytes: 2398 X-Received-Body-CRC: 1928532015 Xref: csiph.com comp.lang.javascript:29025 On 15/12/2015 01:53, Stefan Ram wrote: > I was looking for some DOM applications as examples for my > JavaScript course and came up with this use of the Firefox > console (input/output pairs): > > document.firstElementChild > [...] > > I see that the Firefox console kinda »pretty prints« the > element. I.e., it does not just say > > [object] > > but > > > > . I like this! But can I rely on it? As in "do other browsers do it the same way", then no. Nor is it standardised. Even Firefox may change its behaviour any time the developers want (i.e. it is implementation dependent). > Is this output experimental or is it an established feature? It is an established feature in reasonably modern browsers. > Can it be expected to remain this way in the future? No, see above. > Do other browser consoles behave similar? "Similar" in that they tend to print something more useful than "object", but not consistently the same format and certainly not content. -- Rob