Main

type

5 (blog/news article)

status

21 (imported old-v2, waiting for another import)

review version

0

cleanup version

0

pending deletion

0 (-)

created at

2025-12-25 01:46:22

updated at

2026-02-01 16:00:07

pol page id

3179003768

pol status

0

pol hosts ticketing

pol hosts ecommerce

pol hosts finance

pol hosts crypto

pol hosts leak

pol hosts devel

github.com developer.mozilla.org

pol hosts ugc

pol hosts klim

pol hosts builders

pol hosts self subdomains

pol hosts other subdomains

pol hosts other domains

javascripter.net ecma-international.org tc39.es buttondown.email

pol updated

1770907517

Address

url

https://www.hillelwayne.com/post/javascript-puzzle/

url length

51

url crc

8050

url crc32

431890290

location type

1 (url matches target location, page_location is empty)

canonical status

10 (verified canonical url)

canonical page id

-

Source

domain id

199256381

domain tld

2211

domain parts

2

originating warc id

-

originating url

https://hillelwayne.com/post/javascript-puzzle/

source type

10 (canonical url)

Server response

server ip

18.165.83.22

Publication date

2025-07-12 22:23:44

Fetch attempts

0

Original html size

14507

Normalized and saved size

11609

Content

title

A Perplexing Javascript Parsing Puzzle

excerpt

content


 What does this print? x = 1 x --> 0 Think it through, then try it in a browser console! Answer and explanation in the dropdown. 
 
 
 
 
 
 Show answer
 
 It prints 1. wait wtf At the beginning of a line (and only at the beginning of a line), --> starts a comment. The JavaScript is parsed as x = 1; x; // 0 The browser then displays the value of the last expression, which of course is 1. but why It’s a legacy hack. Netscape Navigator 2 introduced both JavaScript and the <script> tag. Older browsers in common use (like Navigator 1) had no idea that <script> content was anything special and wrote it as regular text on the page. To ensure graceful degradation, webdevs would wrap their scripts in html comment blocks: <script> <!-- console.log("hello world!") --> </script> Old browsers would parse the content as an HTML comment and ignore it, new browsers would parse the content as JavaScrip...

author

updated

1770907517

Text analysis

block type

0

extracted fields

232

extracted bits

title
full content
content was extracted heuristically
OpenGraph suggests this is an article

detected location

0

detected language

1 (English)

category id

-

index version

1

paywall score

0

spam phrases

0

Text statistics

text nonlatin

0

text cyrillic

0

text characters

1521

text words

339

text unique words

197

text lines

1

text sentences

22

text paragraphs

1

text words per sentence

15

text matched phrases

0

text matched dictionaries

0