Quick JavaScript  book cover
1st Edition

Quick JavaScript




  • Available for pre-order on March 14, 2023. Item will ship after April 4, 2023
ISBN 9781032417561
April 4, 2023 Forthcoming by Chapman & Hall
186 Pages 1 B/W Illustrations

FREE Standard Shipping
USD $22.95

Prices & shipping based on shipping country


Preview

Book Description

Are you an experienced programmer who wants to get started quickly in JavaScript and the HTML DOM? This is your book.

Do you need encyclopedic knowledge of JavaScript and/or the HTML DOM? This book is not for you.

Are you a novice who wants to learn to program? This book is not for you. In fact, this language is not for you. Get a good Python book.

This book will get you programming in JavaScript as quickly as possible. In addition, it will provide you with a basic understanding of the Document Object Model, the massive data structure used to represent web pages. With these tools, you will be able to build interactive web pages.

If you program in C++ or Java, there are parts of the book you can skip over, because the JavaScript statements are exactly the same. These parts are clearly marked.

JavaScript is the language—the only language—used by browsers. To create interactive web pages, you need to know both JavaScript and the DOM. This book will get you started.

Table of Contents

About the Author

Preface*

Versions of JavaScript*

1. Introduction*

1-1. Hello, World!*

1-2. JavaScript in the Browser*

1-3. Browser Consoles*

1-4. Running JavaScript*

1-5. Getting Input*

1-6. Producing Output*

2. JavaScript: The Bare Minimum*

2-1. Comments*

2-2. Data Types*

2-2-1. Primitives*

2-2-2. User-Defined Objects*

2-2-3. Built-In Object Types*

2-2-4. Arrays*

2-2-5. Sets*

2-2-6. Maps*

2-2-7. Dates*

2-2-8. Regular Expressions*

2-3. Identifiers*

2-4. let and const*

2-5. var*

2-6. Operators*

2-7. Equality and Identity*

2-8. Conversions*

2-9. Statements*

2-9-1. Semicolons*

2-9-2. Declarations*

2-9-3. Function Definitions*

2-9-4. Familiar Statements*

2-9-4-1. Assignment Statements*

2-9-4-2. Expressions*

2-9-4-3. Compound Statements*

2-9-4-4. If Statements*

2-9-4-5. While Loops*

2-9-4-6. Do-while Loops*

2-9-4-7. Traditional For Loops*

2-9-4-8. Scope in Loops*

2-9-4-9. Switch Statements*

2-9-4-10. Labeled Statements*

2-9-4-11. Break Statements*

2-9-4-12. Continue Statements*

2-9-4-13. Return Statements*

2-9-4-14. Empty Statements*

2-9-5. JavaScript-specific Statements*

2-9-5-1. For/of*

2-9-5-2. For/in*

2-9-5-3. Throw*

2-9-5-4. Try-catch-finally*

2-9-5-5. The with statement*

2-10. Example: Prime Numbers*

2-11. Testing*

2-11-1. The Mocha Test Framework*

2-11-2. Testing With Chai*

2-11-3. Testing Example*

3. JavaScript: In More Detail*

3-1. Strict Mode*

3-2. Identifiers*

3-3. Destructuring*

3-4. Data Types*

3-4-1. Numbers*

3-4-2. Strings*

3-4-3. Booleans*

3-4-4. Symbols*

3-4-5. Arrays*

3-4-6. Sparse Arrays*

3-4-7. Sets*

3-4-8. Maps*

3-4-9. WeakMaps*

3-4-10. Promises*

3-4-11. Conversions*

3-5. Math*

3-6. Reserved Words*

3-7. Good Operators*

3-8. Operator Notes*

3-9. Bad Operators*

3-10. Functions*

3-10-1. Defining Functions*

3-10-2. Parameters and Arguments*

3-10-3. Functions Are Data*

3-10-4. Functions Are Objects*

3-10-5. Function Methods*

3-10-6. Closures*

3-10-7. Generators*

3-10-8. Iterators*

3-11. Objects*

3-11-1. Objects*

3-11-2. Creating Objects*

3-11-3. Copying Objects*

3-11-4. Methods*

3-11-5. Optional Chaining*

3-11-6. this*

3-11-7. Higher-order Functions*

3-11-8. Prototypes*

3-11-9. Descriptors*

3-11-10. Classes and Inheritance*

3-11-10-1. Classes*

3-11-10-2. Inheritance*

3-11-10-3. Overriding Methods and Fields*

3-11-10-4. Class Prototypes*

3-12. Transpilers and Polyfills*

3-13. JSON*

4. Client-Side JavaScript*

4-1. Essential HTML*

4-2. Adding JavaScript to HTML*

4-3. DOM Overview*

4-4. Graphical User Interfaces*

4-4-1. Events*

4-4-2. Widgets*

4-4-3. Buttons*

4-4-4. Finding Widgets*

4-4-5. Text Fields*

4-4-6. Buttons and Forms*

4-4-7. Form Verification*

4-4-8. Form Submission*

4-4-8-1. Get Requests*

4-4-8-2. Post Requests*

4-4-8-3. Other Requests*

4-4-9. Additional Text Widgets*

4-4-10. Other Input Widgets*

4-4-11. Events*

4-4-12. Bubbling*

4-5. Using the DOM*

4-5-1. The Window Object*

4-5-1-1. Window Properties*

4-5-1-2. Window Methods*

4-5-1-3. Window Example*

4-5-2. The Document Object*

4-5-2-1. Document Properties*

4-5-2-2. Finding Nodes*

4-5-2-3. Creating Nodes*

4-5-3. Node Objects*

4-5-3-1. Node Properties*

4-5-3-2. Node Methods*

4-5-4. Elements*

4-5-4-1. Element Properties*

4-5-4-2. Element Methods*

4-5-5. CharacterData*

4-5-6. Example: showTree*

Conclusion*

Appendix A. Array Methods*

Appendix B. Higher-Order Methods*

Appendix C. String Methods*

Appendix D. Regular Expressions*

References

...
View More

Author(s)

Biography

David L. Matuszek was Director of the Masters in Computer and Information Technology course at the University of Pennsylvania, USA (2001-2017). With 40 years teaching experience, and 45 years programming experience, David is skilled in both the design of innovative software systems and in teaching others how to master programming languages in an accessible and engaging way.