Dr. Axel Rauschmayer - Deep JavaScript
Here you can read online Dr. Axel Rauschmayer - Deep JavaScript full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2020, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:
Romance novel
Science fiction
Adventure
Detective
Science
History
Home and family
Prose
Art
Politics
Computer
Non-fiction
Religion
Business
Children
Humor
Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.
- Book:Deep JavaScript
- Author:
- Genre:
- Year:2020
- Rating:5 / 5
- Favourites:Add to favourites
- Your mark:
- 100
- 1
- 2
- 3
- 4
- 5
Deep JavaScript: summary, description and annotation
We offer to read an annotation, description, summary or preface (depends on what the author of the book "Deep JavaScript" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.
Deep JavaScript — read online for free the complete book (whole text) full work
Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Deep JavaScript" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.
Font size:
Interval:
Bookmark:
Dr. Axel Rauschmayer
2020
- 1.1
- 1.2
- 1.3
- 1.4
- 1.5
- 1.6
- 1.7
- 1.7.1
- 1.7.2
- 1.8
The homepage of Deep JavaScript is exploringjs.com/deep-js/
This book dives deeply into JavaScript:
- It teaches practical techniques for using the language better.
- It teaches how the language works and why. What it teaches is firmly grounded in the ECMAScript specification (which the book explains and refers to).
- It covers only the language (ignoring platform-specific features such as browser APIs) but not exhaustively. Instead, it focuses on a selection of important topics.
If you buy this book, you get:
- The current content in four DRM-free versions:
- PDF file
- ZIP archive with ad-free HTML
- EPUB file
- MOBI file
- Any future content that is added to this edition. How much I can add depends on the sales of this book.
The current price is introductory. It will increase as more content is added.
On the homepage of this book, there are extensive previews for all versions of this book.
- The HTML version of this book has a link to comments at the end of each chapter.
- They jump to GitHub issues, which you can also access directly.
- You can read the chapters in any order. Each one is self-contained but occasionally, there are references to other chapters with further information.
- The headings of some sections are marked with (optional) meaning that they are non-essential. You will still understand the remainders of their chapters if you skip them.
For example, you may see:
Number . isFinite (num : number ) : boolean
That is called the type signature of Number.isFinite()
. This notation, especially the static types number
of num
and boolean
of the result, are not real JavaScript. The notation is borrowed from the compile-to-JavaScript language TypeScript (which is mostly just JavaScript plus static typing).
Why is this notation being used? It helps give you a quick idea of how a function works. The notation is explained in detail in a 2ality blog post, but is usually relatively intuitive.
Reading instructions
Explains how to best read the content.
External content
Points to additional, external, content.
Tip
Gives a tip related to the current content.
Question
Asks and answers a question pertinent to the current content (think FAQ).
Warning
Warns about pitfalls, etc.
Details
Provides additional details, complementing the current content. It is similar to a footnote.
Thanks to Allen Wirfs-Brock for his advice via Twitter and blog post comments. It helped make this book better.
More people who contributed are acknowledged in the chapters.
- 2.1
- 2.1.1
- 2.2
- 2.2.1
- 2.2.2
- 2.2.3
- 2.2.4
- 2.2.5
- 2.3
- 2.4
- 2.4.1
- 2.4.2
- 2.4.3
- 2.4.4
- 2.5
- 2.5.1
- 2.5.2
- 2.6
In this chapter, we examine the role of type coercion in JavaScript. We will go relatively deeply into this subject and, e.g., look into how the ECMAScript specification handles coercion.
Each operation (function, operator, etc.) expects its parameters to have certain types. If a value doesnt have the right type for a parameter, three common options for, e.g., a function are:
The function can throw an exception:
}
The function can return an error value:
}
The function can convert its arguments to useful values:
}
In (3), the operation performs an implicit type conversion. That is called type coercion.
JavaScript initially didnt have exceptions, which is why it uses coercion and error values for most of its operations:
assert . equal ( Number ( 'xyz' ) , NaN ) ;
However, there are also cases (especially when it comes to newer features) where it throws exceptions if an argument doesnt have the right type:
Accessing properties of
null
orundefined
:TypeError: Cannot use 'in' operator to search for 'prop' in null
Using symbols:
TypeError: Cannot convert a Symbol value to a number
Mixing bigints and numbers:
TypeError: Cannot mix BigInt and other types
New-calling or function-calling values that dont support that operation:
TypeError: (intermediate value) is not a constructor
Changing read-only properties (only throws in strict mode):
TypeError: Cannot assign to read only property 'prop'
Two common ways of dealing with coercion are:
A caller can explicitly convert values so that they have the right types. For example, in the following interaction, we want to multiply two numbers encoded as strings:
assert . equal ( Number (x) * Number (y) , ) ;
A caller can let the operation make the conversion for them:
assert . equal (x * y , ) ;
I usually prefer the former, because it clarifies my intention: I expect x
and y
not to be numbers, but want to multiply two numbers.
The following sections describe the most important internal functions used by the ECMAScript specification to convert actual parameters to expected types.
For example, in TypeScript, we would write:
}
In the specification, this looks as follows (translated to JavaScript, so that it is easier to understand):
}
Whenever primitive types or objects are expected, the following conversion functions are used:
Font size:
Interval:
Bookmark:
Similar books «Deep JavaScript»
Look at similar books to Deep JavaScript. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.
Discussion, reviews of the book Deep JavaScript and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.