TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Eloquent JavaScript 4th edition (2024)

1274 点作者 vajdagabor大约 1 年前

45 条评论

samtho大约 1 年前
This is, in my opinion, the book to use to learn JavaScript at more than a surface level. The only other materials I recommend as much (but for a different level of learner) are the “You don’t know JavaScript” in-depth book series.<p>In 2015, I was consulting for a distance learning program, administered by a major California University, that wanted to replace their current textbook (one of those “Head First” O’Reilly books) with something that had a bit more meat but was very approachable. I immediately recommended this and it was fawned over by both the advisors and instructors. It was also the cheapest option they had in the running (even excluding the fact it can be read for free) as it was competing against traditional text books. One year later, students were polled on it and it was met with a lot of positivity as well.
评论 #39630538 未加载
评论 #39631085 未加载
评论 #39633925 未加载
评论 #39631496 未加载
评论 #39634851 未加载
评论 #39630785 未加载
评论 #39631013 未加载
评论 #39638807 未加载
评论 #39630432 未加载
wes-k大约 1 年前
For those that don&#x27;t know the author, Marijn Haverbeke is the creator of CodeMirror (code editor) and later ProseMirror (text editor).<p><a href="https:&#x2F;&#x2F;codemirror.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;codemirror.net&#x2F;</a><p><a href="https:&#x2F;&#x2F;prosemirror.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;prosemirror.net&#x2F;</a>
评论 #39637260 未加载
评论 #39639373 未加载
NlightNFotis大约 1 年前
Fancy seeing this here, some days after finishing the third version :)<p>I&#x27;m also glad to see the asynchronous programming chapter significantly reworked - it was materially weaker than the rest of the book because of some weird analogies involving crows and their nests that didn&#x27;t seem to make any sort of sense to me.<p>The third edition also gave me the impression that it was a reasonable book to learn JS and the DOM (and a sprinkle of Node.js, for good measure), but that it was a book aimed primarily at experienced people who were transitioning to JS and the web - not beginners (despite the book&#x27;s efforts at claiming suitability for beginner programmers).
评论 #39631533 未加载
评论 #39649129 未加载
aydoubleyou大约 1 年前
I don&#x27;t consider myself a good programmer. I struggled throughout my youth to grasp even the basics. This book pointed me in the right direction. Can&#x27;t recommend it enough.
评论 #39653386 未加载
noname120大约 1 年前
My go-to JavaScript book will always remain “JavaScript for impatient programmers”[1], a 639-page book written by Dr. Axel, PhD.<p>It&#x27;s quite complete and detailed. But as if it wasn&#x27;t enough the author wrote a second (smaller book) named “Deep JavaScript: Theory and techniques”[2].<p>Both are free to read online!<p>[1] <a href="https:&#x2F;&#x2F;exploringjs.com&#x2F;impatient-js&#x2F;" rel="nofollow">https:&#x2F;&#x2F;exploringjs.com&#x2F;impatient-js&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;exploringjs.com&#x2F;deep-js&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;exploringjs.com&#x2F;deep-js&#x2F;index.html</a>
felipefar大约 1 年前
Part of the force of this book comes from its explanation of fundamentals of computing, and how it relates to javascript. Another part is due to how interesting are the projects that it proposes that the reader build. I don&#x27;t even like programming in javascript but was drawn to read the book.
svat大约 1 年前
I love this book, even since its first edition. It&#x27;s very clear even on elementary stuff, e.g. see the section on bindings&#x2F;variables: <a href="https:&#x2F;&#x2F;eloquentjavascript.net&#x2F;02_program_structure.html#h-lnOC+GBEtu" rel="nofollow">https:&#x2F;&#x2F;eloquentjavascript.net&#x2F;02_program_structure.html#h-l...</a> — avoids the pitfall of thinking of variables as “boxes”.<p>I was trying to find what&#x27;s new in the 4th edition, and following links from the author&#x27;s website <a href="https:&#x2F;&#x2F;marijnhaverbeke.nl&#x2F;" rel="nofollow">https:&#x2F;&#x2F;marijnhaverbeke.nl&#x2F;</a> found this on Mastodon (<a href="https:&#x2F;&#x2F;mastodon.social&#x2F;@marijn&#x2F;112020092273623390" rel="nofollow">https:&#x2F;&#x2F;mastodon.social&#x2F;@marijn&#x2F;112020092273623390</a>):<p>&gt; <i>The FOURTH EDITION of Eloquent JavaScript is now online, adjusted to the realities of 2024 and generally touched up.</i>
评论 #39630458 未加载
评论 #39630370 未加载
评论 #39630390 未加载
评论 #39630546 未加载
评论 #39630142 未加载
jmkni大约 1 年前
Chapter 11 on async is particularly good, I still get confused by async&#x2F;promises sometimes in Javascript - <a href="https:&#x2F;&#x2F;eloquentjavascript.net&#x2F;11_async.html" rel="nofollow">https:&#x2F;&#x2F;eloquentjavascript.net&#x2F;11_async.html</a>
ibobev大约 1 年前
I&#x27;m currently going through a hard copy of the book&#x27;s third edition. But I&#x27;m wondering whether the description of the language in the book is detailed enough. Could you share some opinions on whether it will be good to go through some other JavaScript books after it? I&#x27;m considering going through &quot;JavaScript: The Definitive Guide&quot;[1] or &quot;The Modern JavaScript Tutorial&quot;[2] after it.<p>[1] <a href="https:&#x2F;&#x2F;www.amazon.com&#x2F;JavaScript-Definitive-Most-Used-Programming-Language&#x2F;dp&#x2F;1491952024&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.amazon.com&#x2F;JavaScript-Definitive-Most-Used-Progr...</a><p>[2] <a href="https:&#x2F;&#x2F;javascript.info&#x2F;" rel="nofollow">https:&#x2F;&#x2F;javascript.info&#x2F;</a>
评论 #39631975 未加载
veggieWHITES大约 1 年前
&gt;The field of programming is young and still developing rapidly, and it is varied enough to have room for wildly different approaches.<p>This was an interesting line of thought to digest. He&#x27;s right, of course. Programming is probably still in it&#x27;s infancy.<p>Studying and learning about programming however, can make you believe it&#x27;s some ancient art mastered by the giants of our recent past, the perfection of which is never to be surpassed again.
TheRealPomax大约 1 年前
The one odd thing in it is that it still claims SVG markup needs a namespace. Which it doesn&#x27;t, SVG became part of the HTML5 spec and emphatically should _not_ use namespaces when used as &quot;just another element&quot; inside an HTML document.<p>(even though you <i>do</i> need a namespace when creating svg elements through createElementNS, both &quot;of course&quot; and &quot;unfortunately&quot;, and of course you need namespaces if you&#x27;re creating an actual stand-alone SVG document)
tracker1大约 1 年前
Like that this now includes a chapter on Node. I think it would be nice to see a follow-up book in a similar style that covers a bit more with Node, Deno and Bun.<p>I really like the Deno approach so far. I prefer TS mostly these days as well as the esm stroke modules. I think node just made usage harder in their approach. I understand why, I still disagree on the solution.
gassiss大约 1 年前
Seconding the sentiment on this thread, I used this book to learn JS 5 years ago, and it&#x27;s awesome. I&#x27;ve never seen another resource as good. YDKJS is more of an advanced treatment. If you&#x27;re a beginner it feels academic, while Eloquent JS is very practical and approachable.
richrichie大约 1 年前
&gt; Every now and then, someone comes up with a new way to circumvent the limitations of a browser and do something harmful, ranging from leaking minor private information to taking over the whole machine that the browser runs on. The browser developers respond by fixing the hole, and all is well again—until the next problem is discovered, and hopefully publicized, rather than secretly exploited by some <i>government agency or criminal organisation</i>.<p>This is from the chapter on HTML and JS (emphasis mine). It is funny to see how govt agencies and criminal organisations are mentioned in the same breath. How did we end up here?
greenie_beans大约 1 年前
this book taught me javascript! great book, highly recommend it.
评论 #39630078 未加载
mixmastamyk大约 1 年前
I have Zakas&#x27; Professional JavaScript for Web Developers and ECMAS 6 update. Was very happy with them (easy to read) but both are getting long in the tooth and the author seems to have lost interest in updates.<p>How does this one compare as an all-in-one? Being up to date is a win, but I&#x27;m wondering about the quality of the writing.
ravenstine大约 1 年前
I don&#x27;t mean to throw shade on the whole book, but I don&#x27;t think the section on errors takes things in the right direction.<p>A distinction should be made between errors and exceptions. In JavaScript and many languages, we conflate the two and use exception handling as logic flow control. In my experience, this can end up being a headache and encourage unnecessarily weird structuring of code.<p>Look at this example from the page on errors:<p>---<p>function getAccount() {<p><pre><code> let accountName = prompt(&quot;Enter an account name&quot;); if (!Object.hasOwn(accounts, accountName)) { throw new Error(`No such account: ${accountName}`); } return accountName; </code></pre> }<p>---<p>The possibility that a user will enter a account name that doesn&#x27;t exist is not an exception, but we are treating it like one in this case. In order to handle this exception when getAccount is called, we have to wrap it or some higher level scope in a try-block and then regex-match the error message if we want to handle it differently from other errors.<p>You might be saying &quot;it&#x27;s just an example&quot;, but there&#x27;s plenty of production code in the wild that is written this way. Maybe this could be improved by subclassing Error, but now you&#x27;re having to manage a bunch of clutter and using object-oriented features as a way to reliably determine what kind of exception you&#x27;re dealing with.<p>I find this pattern to be preferable:<p>---<p>const ACCOUNT_NOT_FOUND_ERROR_CODE = 1;<p>function getAccount() {<p><pre><code> let accountName = prompt(&quot;Enter an account name&quot;); if (!Object.hasOwn(accounts, accountName)) { return { accountName: null, error: { code: ACCOUNT_NOT_FOUND_ERROR_CODE, message: `No such account: ${accountName}`, } }; } return { accountName, error: null };</code></pre> }<p>---<p>Then we can call the function like this:<p>---<p>const { accountName, error } = getAccount();<p>if (error) {<p><pre><code> if (error.code === ACCOUNT_NOT_FOUND_ERROR_CODE) { errorModalService.show(error.message); } </code></pre> } else {<p><pre><code> &#x2F;&#x2F; do something with the account name </code></pre> }<p>---<p>No doubt, you may still want to catch exceptions at a higher level scope, but at the nice thing here is that exceptions (almost) always represent actual unexpected conditions that aren&#x27;t being handled properly while return values with error codes represent expected conditions and can be handled like any other logic in your code. It also reduces any ambiguity of <i>how</i> an error should be handled but without subclassing. An error can even contain more information than just a message if you want it to.<p>Also, if you really want to ignore an error for some reason, then you can just pretend that the error doesn&#x27;t exist. No need to use a try-catch where the catch-block is a no-op.<p>I wish we&#x27;d encourage this sort of pattern, but maybe that&#x27;s one of many pipe dreams of mine.
评论 #39633026 未加载
评论 #39634737 未加载
评论 #39633388 未加载
评论 #39635199 未加载
synergy20大约 1 年前
Great book, looking for some info about main changes from 3rd edition but did not find it.
isquaredr大约 1 年前
Any suggestions from the community on the best way to consume this site as an audio book? I know I could scrape and feed into a text-to-speech library but was wondering: is there is anything off-the-shelf?
jslakro大约 1 年前
First jquery, then React, now this book reaches a new version. Good times for JS
radicalriddler大约 1 年前
Frustrating that the online version uses weird format for it&#x27;s code blocks, which leads reader view (Mozilla Readability) to not put code in a &lt;pre&gt; tag or a &lt;code&gt; tag and leaves it as plain text.
评论 #39651217 未加载
jrvarela56大约 1 年前
I love the web version has a feature to link back to any given paragraph. I hadn&#x27;t noticed this in any other site and found it delightful.
ArcMex大约 1 年前
In my interactions with Marijn, he’s been very responsive. I’m happy to see this release and wish him continued success.<p>I learned JS from the second edition.<p>Incredible resource.
prudentpomelo大约 1 年前
Definitely one of my favorites. It helped me level up when I was learning Javascript but also helped me understand how to be a better programmer.
jgord大约 1 年前
Looks pretty solid.<p>CH 5 : &quot;Higher Order Functions&quot; seems a nice segway into one of my favorite, lesser known js util libraries Ramda.js
pojzon大约 1 年前
To learn js I recommend „WAT” tutorial.<p>Nothing changes in last few years. We still go in with what we incorrectly assumed at the start.
jimhefferon大约 1 年前
Does the author ever talk about why he is publishing a free version along with a more traditional paper version?
评论 #39651218 未加载
looshch大约 1 年前
does anyone know where can i get the list of changes compared with the previous edition?
评论 #39636535 未加载
slow_typist大约 1 年前
How does Eloquent JavaScript compare with Horstmann‘s JavaScript for the Impatient?
评论 #39641277 未加载
lazysalmon35大约 1 年前
When is the print book coming ?
评论 #39637265 未加载
justanotheratom大约 1 年前
I wonder if such high quality free books are already fed to LLMs during training?
评论 #39636347 未加载
cradle大约 1 年前
Where is the physical copy of the 4th edition? I can&#x27;t find it.
评论 #39642276 未加载
tithos大约 1 年前
<a href="https:&#x2F;&#x2F;arc.net&#x2F;boost&#x2F;3098D5E3-F164-478B-9586-077889192460" rel="nofollow">https:&#x2F;&#x2F;arc.net&#x2F;boost&#x2F;3098D5E3-F164-478B-9586-077889192460</a><p>The &#x27;Eloquent JavaScript 4th edition (2024)&#x27; in Dark Mode
degun大约 1 年前
This is what really taught me JavaScript.
ginkgotree大约 1 年前
The best JavaScript book out there, IMHO
justanotheratom大约 1 年前
What if one is using TypeScript?
评论 #39631771 未加载
coding-saints大约 1 年前
Great book
msoad大约 1 年前
This is the book that helped me really understand JavaScript. Really great content and I can&#x27;t thank Marjin enough for putting this out there for free.<p>Also how this person is so productive? I really would love to read on how he manages his time and priorities.
评论 #39653709 未加载
评论 #39630038 未加载
评论 #39629971 未加载
z3t4大约 1 年前
Someone asked about integer support in JavaScript. JS now supports BigInt!<p><pre><code> &gt;2**57 144115188075855870 &gt;2n**57n 144115188075855872n</code></pre>
评论 #39630916 未加载
评论 #39630435 未加载
评论 #39631146 未加载
评论 #39630489 未加载
评论 #39632347 未加载
llmzero大约 1 年前
What&#x27;s new in this edition?
评论 #39630788 未加载
评论 #39632157 未加载
评论 #39630162 未加载
评论 #39630270 未加载
boringuser2大约 1 年前
This book took me from having nothing -- literally being a political science major grocery store employee -- to making 2xx,xxx YOY.<p>It was challenging and made me question whether or not I had it in me to code. Turns out, I could, and, vis-a-vis my peers, exceptionally well.<p>Well, I took me, but this book was my first real introduction to computer science.<p>Funnily enough, I didn&#x27;t then and don&#x27;t now personally care for the author (he seems untalented as a teacher), but I feel he accidentally made a good resource in his hubris.
评论 #39651387 未加载
评论 #39653470 未加载
dcre大约 1 年前
This is my favorite book about JS, and I always recommend it to people. It occurs to me for the first time that the lack of TypeScript might be a problem, because if I’m making recommendations to someone learning, I am definitely going to recommend they write TS instead of JS. On the other hand it may actually be helpful to learn the concepts in this book without the additional syntax overhead of type annotations, plus the more webby content doesn’t really have much to do with types anyway.
评论 #39629890 未加载
评论 #39629966 未加载
评论 #39630419 未加载
评论 #39630208 未加载
评论 #39630260 未加载
alyandon大约 1 年前
Serious question - has Javascript the language evolved any features for handling integer math correctly so expressions like 2*57 aren&#x27;t silently rounded? I realize that in most cases Javascriopt is &quot;good enough&quot; for useful work but I&#x27;ve seen even senior engineers get tripped up by Javascript&#x27;s corner cases when it comes to its handling of integer vs float.
评论 #39630206 未加载
评论 #39630233 未加载
评论 #39630266 未加载
illegalsmile大约 1 年前
test
_obviously大约 1 年前
Sounds like a joke, an oxymoron.