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-04 10:01:22

updated at

2025-12-04 10:01:24

Address

url

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

url length

47

url crc

49814

url crc32

2516501142

location type

1 (url matches target location, page_location is empty)

canonical status

30 (canonical url is different, page_canonical_page_id points to it)

canonical page id

3179003768

Source

domain id

199256381

domain tld

2211

domain parts

0

originating warc id

-

originating url

https://data.commoncrawl.org/crawl-data/CC-MAIN-2025-33/segments/1754151279901.12/warc/CC-MAIN-20250806074443-20250806104443-00442.warc.gz

source type

11 (CommonCrawl)

Server response

server ip

18.165.83.22

Publication date

2025-08-06 08:16:04

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

1767188012

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

Other [en] (231)

index version

2025123101

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