Javascript Absolute Beginner's Guide, 3rd Edition

Book description

Make the most of today's JavaScript--even if youve never programmed anything before. JavaScript Absolute Beginner's Guide, Third Edition is the fastest way to learn JavaScript, starting with the basics and gradually going deeper and broader into all the techniques you need to begin building highly scalable, performant web apps and experiences. Do what you want, the way you want, one incredibly easy step at a time!

Learn all this, and much more:

  • Start fast with the basics: values, variables, functions, conditionals, loops, closures, and more

  • Create well-organized, clear code thats easy to reuse and improve

  • Learn proven best practices to build web apps that scale with outstanding performance

  • Make the most of powerful object-oriented techniques to build complex, extensible apps

  • Wrangle data like a pro by learning how to use the popular JSON standard, arrays, web storage, and more

  • Translate your ideas into visually compelling and interactive content by learning how to work with the DOM

  • Identify and fix issues quickly by learning how to use the in-browser development tools

  • Understand the ins and outs of events and how you can use them to react to actions the user or the page will perform

  • Learn how to ensure your code runs lightning-fast with extra coverage of performance optimizations and techniques you can use

  • Learn the basics that set you up to more quickly use modern web frameworks like React, Vue, Next.js, and Nuxt

  • Explore advanced features such as object destructuring, making web requests, the class syntax, accessing your webcam, variable hoisting, and more

  • Get up-to-speed on the latest JavaScript enhancements proposed by the EcmaScript standard

..

Table of contents

  1. Cover Page
  2. About This eBook
  3. Title Page
  4. Copyright Page
  5. Pearson’s Commitment to Diversity, Equity, and Inclusion
  6. Credits
  7. Contents at a Glance
  8. Reader Services
  9. Table of Contents
  10. About the Author
  11. About the Technical Editor
  12. Dedication
  13. Acknowledgments
  14. We Want to Hear from You!
  15. Introduction
    1. Parlez-Vous JavaScript?
    2. Contacting Me/Getting Help
  16. 1 Hello, World!
    1. What Is JavaScript?
    2. Hello, World!
    3. Statements, Expressions, and Functions
  17. I The Basic Stuff
    1. 2 Values and Variables
      1. Using Variables
      2. More Variable Stuff
    2. 3 Functions
      1. What Is a Function?
      2. A Simple Function
      3. Creating a Function That Takes Arguments
      4. Creating a Function That Returns Data
    3. 4 Conditional Statements: if, else, and switch
      1. The If/Else Statement
      2. Switch Statements
      3. Deciding Which to Use
    4. 5 Looping with for, while, and do…while!
      1. The for Loop
      2. The Starting Point
      3. Some for Loop Examples
      4. The Other Loops
    5. 6 Commenting Your Code…FTW!
      1. What Are Comments?
      2. Commenting Best Practices
    6. 7 Timers
      1. Delaying with setTimeout
    7. 8 Variable Scope
      1. Global Scope
      2. Local Scope
      3. Miscellaneous Scoping Shenanigans
    8. 9 Closures
      1. Functions Within Functions
      2. When the Inner Functions Aren’t Self-Contained
    9. 10 Where Should Your Code Live?
      1. Approach #1: All the Code Lives in Your HTML Document
      2. Approach #2: The Code Lives in a Separate File
      3. So, Which Approach to Use?
    10. 11 Console Logging Basics
      1. Meet the Console
      2. Displaying the Console
      3. If You Want to Follow Along
      4. Console Logging 101
  18. II It’s an Object-Oriented World
    1. 12 Of Pizza, Types, Primitives, and Objects
      1. Let’s First Talk About Pizza
      2. From Pizza to JavaScript!
      3. What Are Objects?
      4. The Predefined Objects Roaming Around in JavaScript
    2. 13 Arrays
      1. Creating an Array
      2. Accessing Array Values
      3. Adding Items
      4. Removing Items
      5. Finding Items
      6. Merging Arrays
      7. Mapping, Filtering, and Reducing Arrays
      8. The Old School Way
      9. Modifying Each Array Item with map
      10. Getting One Value from an Array of Items
      11. A Short Foray into Functional Programming
    3. 14 Strings
      1. The Basics
      2. String Properties and Methods
    4. 15 Combining Strings and Variables
      1. Our Setup
    5. 16 When Primitives Behave Like Objects
      1. Strings Aren’t the Only Problem
      2. Let’s Pick on Strings Anyway
      3. Why This Matters
    6. 17 Numbers
      1. Using a Number
      2. Operators
      3. Incrementing and Decrementing
      4. Hexadecimal and Octal Values
      5. Special Values—Infinity and NaN
      6. The Math Object
      7. Random Numbers
    7. 18 Getters and Setters
      1. A Tale of Two Properties
      2. Meet Getters and Setters
    8. 19 A Deeper Look at Objects
      1. Meet the Object
      2. Creating Custom Objects
      3. The this Keyword
    9. 20 Using Classes
      1. The Class Syntax and Object Creation
      2. Extending Objects
    10. 21 Extending Built-in Objects
      1. Say Hello to prototype Again, Sort Of!
      2. Using a Subclassing Approach
      3. Extending Built-in Objects Is Controversial
    11. 22 Arrow Functions
      1. What Are Arrow Functions?
      2. Putting It All Together
    12. 23 Making Sense of this and More
      1. The this Keyword 101
    13. 24 Booleans and the Stricter === and !== Operators
      1. The Boolean Object
      2. The Boolean Function
      3. Strict Equality and Inequality Operators
    14. 25 Null and Undefined
      1. Null
      2. Undefined
    15. 26 All About JSON (JavaScript Object Notation)
      1. What Is JSON?
      2. Looking Inside a JSON Object
      3. Reading JSON Data
      4. Writing JSON Data?
  19. III Working with the DOM
    1. 27 JS, the Browser, and the DOM
      1. What HTML, CSS, and JavaScript Do
      2. HTML Defines the Structure
      3. Prettify My World, CSS!
      4. It’s JavaScript Time!
      5. Meet the Document Object Model
    2. 28 Finding Elements in the DOM
      1. Meet the querySelector Family
      2. It Really Is the CSS Selector Syntax
    3. 29 Modifying DOM Elements
      1. DOM Elements Are Objects, Sort Of!
      2. Let’s Actually Modify DOM Elements
    4. 30 Styling Our Content
      1. Why Would We Set Styles Using JavaScript?
      2. A Tale of Two Styling Approaches
    5. 31 Using CSS Custom Properties
      1. What Are CSS Custom Properties/Variables?
      2. Setting Complex Values Easily
    6. 32 Traversing the DOM
      1. Finding Your Way Around
      2. Putting It All Together
    7. 33 Creating and Removing DOM Elements
      1. Creating Elements
      2. Removing Elements
      3. Cloning Elements
    8. 34 Quickly Adding Many Elements into the DOM
      1. General Approach
      2. Getting Started
    9. 35 In-Browser Developer Tools
      1. Meet the Developer Tools
  20. IV Dealing with Events
    1. 36 Events
      1. What Are Events?
      2. Events and JavaScript
      3. A Simple Example
      4. The Event Arguments and the Event Type
    2. 37 Event Bubbling and Capturing
      1. Event Goes Down, Event Goes Up
      2. Meet the Phases
      3. Who Cares?
      4. Event, Interrupted
    3. 38 Mouse Events
      1. Meet the Mouse Events
      2. The MouseEvent Properties
      3. Dealing with the Mouse Wheel
    4. 39 Keyboard Events
      1. Meet the Keyboard Events
      2. Using These Events
      3. The Keyboard Event Properties
      4. Some Examples
    5. 40 Page Load Events and Other Stuff
      1. The Things That Happen During Page Load
      2. The DOMContentLoaded and load Events
      3. Scripts and Their Location in the DOM
      4. Script Elements: async and defer
    6. 41 Loading Script Files Dynamically
      1. The Basic Technique
      2. Running Our Dynamically Loaded Script First
      3. Running Dependent Code After Our Script File Has Loaded
    7. 42 Handling Events for Multiple Elements
      1. How to Do All This
  21. V Totally Useful Topics that Only Make Sense Now
    1. 43 Using Emojis in HTML, CSS, and JavaScript
      1. What Are Emojis Exactly?
      2. Emojis in HTML
    2. 44 Making HTTP/Web Requests in JavaScript
      1. The Example
      2. Meet Fetch
      3. Meet XMLHttpRequest
    3. 45 Accessing the Webcam
      1. The Example
      2. Overview of How This Works
      3. Adding the Code
      4. Examining the Code
    4. 46 Array and Object Destructuring
      1. Destructuring Examples
    5. 47 Storing Data Using Web Storage
      1. How Web Storage Works
      2. Getting Your Code On
    6. 48 Variable and Function Hoisting
      1. JavaScript and Compiler Behavior
    7. 49 Working with Sets
      1. Creating a Set, Part I
      2. Adding Items to a Set
      3. How Checking for Duplicates Works
      4. Creating a Set, Part 2
      5. Checking the Size of Our Set
      6. Deleting Items from a Set
      7. Checking If an Item Exists
      8. Looping Through Items in a Set
      9. Entries, Keys, and Values
    8. 50 Conclusion
  22. Glossary
  23. Index
  24. Code Snippets

Product information

  • Title: Javascript Absolute Beginner's Guide, 3rd Edition
  • Author(s): Kirupa Chinnathambi
  • Release date: November 2022
  • Publisher(s): Que
  • ISBN: 9780137959211