Learning javascript ethan brown

Learning JavaScript, 3rd Edition

Learning JavaScript, 3rd Edition

Read it now on the O’Reilly learning platform with a 10-day free trial.

O’Reilly members get unlimited access to books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.

Book description

This is an exciting time to learn JavaScript. Now that the latest JavaScript specification—ECMAScript 6.0 (ES6)—has been finalized, learning how to develop high-quality applications with this language is easier and more satisfying than ever. This practical book takes programmers (amateurs and pros alike) on a no-nonsense tour of ES6, along with some related tools and techniques.

Author Ethan Brown (Web Development with Node and Express) not only guides you through simple and straightforward topics (variables, control flow, arrays), but also covers complex concepts such as functional and asynchronous programming. You’ll learn how to create powerful and responsive web applications on the client, or with Node.js on the server.

  • Use ES6 today and transcompile code to portable ES5
  • Translate data into a format that JavaScript can use
  • Understand the basic usage and mechanics of JavaScript functions
  • Explore objects and object-oriented programming
  • Tackle new concepts such as iterators, generators, and proxies
  • Grasp the complexities of asynchronous programming
  • Work with the Document Object Model for browser-based apps
  • Learn Node.js fundamentals for developing server-side applications

Publisher resources

Table of contents

  1. Preface
    1. A Brief History of JavaScript
    2. ES6
    3. Who This Book Is For
    4. What This Book Is Not
    5. Conventions Used in This Book
    6. O’Reilly Safari
    7. How to Contact Us
    8. Acknowledgments
    1. Where to Start
    2. The Tools
    3. A Comment on Comments
    4. Getting Started
    5. The JavaScript Console
    6. Drawing Graphics Primitives
    7. Automating Repetitive Tasks
    8. Handling User Input
    9. Hello, World
    1. Prerequisites
      1. Your Project Root
      1. Installing Node
      2. Running JavaScript Programs with Node
      3. Package Management: npm
      1. Variables and Constants
      2. Variables or Constants: Which to Use?
      3. Identifier Names
      4. Literals
      5. Primitive Types and Objects
      6. Numbers
      7. Strings
        1. Escaping
        1. Template Strings
        2. Multiline Strings
        3. Numbers as Strings
        1. Converting to Numbers
        2. Converting to String
        3. Converting to Boolean
        1. A Control Flow Primer
          1. while Loops
          2. Block Statements
          3. Whitespace
          4. Helper Functions
          5. if…else Statement
          6. do…while Loop
          7. for Loop
          8. if Statement
          9. Putting It All Together
          1. Control Flow Exceptions
          2. Chaining if. else Statements
          3. Metasyntax
          4. Additional for Loop Patterns
          5. switch Statements
          6. for. in loop
          7. for. of loop
          1. Using continue to Reduce Conditional Nesting
          2. Using break or return to Avoid Unnecessary Computation
          3. Using Value of Index After Loop Completion
          4. Using Descending Indexes When Modifying Lists
          1. Operators
          2. Arithmetic Operators
          3. Operator Precedence
          4. Comparison Operators
          5. Comparing Numbers
          6. String Concatenation
          7. Logical Operators
            1. Truthy and Falsy Values
            1. Short-Circuit Evaluation
            2. Logical Operators with Nonboolean Operands
            3. Conditional Operator
            4. Comma Operator
            1. Bitwise Operators
            2. typeof Operator
            3. void Operator
            4. Assignment Operators
            1. Converting if. else Statements to Conditional Expressions
            2. Converting if Statements to Short-Circuited Logical OR Expressions
            1. Return Values
            2. Calling Versus Referencing
            3. Function Arguments
              1. Do Arguments Make the Function?
              2. Destructuring Arguments
              3. Default Arguments
              1. Scope Versus Existence
              2. Lexical Versus Dynamic Scoping
              3. Global Scope
              4. Block Scope
              5. Variable Masking
              6. Functions, Closures, and Lexical Scope
              7. Immediately Invoked Function Expressions
              8. Function Scope and Hoisting
              9. Function Hoisting
              10. The Temporal Dead Zone
              11. Strict Mode
              12. Conclusion
              1. A Review of Arrays
              2. Array Content Manipulation
                1. Adding or Removing Single Elements at the Beginning or End
                2. Adding Multiple Elements at the End
                3. Getting a Subarray
                4. Adding or Removing Elements at Any Position
                5. Cutting and Replacing Within an Array
                6. Filling an Array with a Specific Value
                7. Reversing and Sorting Arrays
                1. Property Enumeration
                  1. for. in
                  2. Object.keys
                  1. Class and Instance Creation
                  2. Dynamic Properties
                  3. Classes Are Functions
                  4. The Prototype
                  5. Static Methods
                  6. Inheritance
                  7. Polymorphism
                  8. Enumerating Object Properties, Revisited
                  9. String Representation
                  1. Maps
                  2. Weak Maps
                  3. Sets
                  4. Weak Sets
                  5. Breaking the Object Habit
                  1. The Error Object
                  2. Exception Handling with try and catch
                  3. Throwing Errors
                  4. Exception Handling and the Call Stack
                  5. try. catch. finally
                  6. Let Exceptions Be Exceptional
                  1. The Iteration Protocol
                  2. Generators
                    1. yield Expressions and Two-Way Communication
                    2. Generators and return
                    1. Functions as Subroutines
                    2. Functions as Subroutines That Return a Value
                    3. Functions as…Functions
                    4. So What?
                      1. Functions Are Objects
                      1. Functions in an Array
                      2. Pass a Function into a Function
                      3. Return a Function from a Function
                      1. The Analogy
                      2. Callbacks
                        1. setInterval and clearInterval
                        2. Scope and Asynchronous Execution
                        3. Error-First Callbacks
                        4. Callback Hell
                        1. Creating Promises
                        2. Using Promises
                        3. Events
                        4. Promise Chaining
                        5. Preventing Unsettled Promises
                        1. One Step Forward and Two Steps Back?
                        2. Don’t Write Your Own Generator Runner
                        3. Exception Handling in Generator Runners
                        1. Dates, Time Zones, Timestamps, and the Unix Epoch
                        2. Constructing Date Objects
                        3. Moment.js
                        4. A Practical Approach to Dates in JavaScript
                        5. Constructing Dates
                          1. Constructing Dates on the Server
                          2. Constructing Dates in the Browser
                          1. Formatting Numbers
                            1. Fixed Decimals
                            2. Exponential Notation
                            3. Fixed Precision
                            4. Different Bases
                            5. Advanced Number Formatting
                            1. Exponentiation
                            2. Logarithmic Functions
                            3. Miscellaneous
                            4. Pseudorandom Number Generation
                            1. Substring Matching and Replacing
                            2. Constructing Regular Expressions
                            3. Searching with Regular Expressions
                            4. Replacing with Regular Expressions
                            5. Input Consumption
                            6. Alternation
                            7. Matching HTML
                            8. Character Sets
                            9. Named Character Sets
                            10. Repetition
                            11. The Period Metacharacter and Escaping
                              1. A True Wildcard
                              1. The Document Object Model
                              2. Some Tree Terminology
                              3. DOM “Get” Methods
                              4. Querying DOM Elements
                              5. Manipulating DOM Elements
                              6. Creating New DOM Elements
                              7. Styling Elements
                              8. Data Attributes
                              9. Events
                                1. Event Capturing and Bubbling
                                2. Event Categories
                                1. Node Fundamentals
                                2. Modules
                                3. Core Modules, File Modules, and npm Modules
                                4. Customizing Modules with Function Modules
                                5. Filesystem Access
                                6. Process
                                7. Operating System
                                8. Child Processes
                                9. Streams
                                10. Web Servers
                                11. Conclusion
                                1. Accessor Properties: Getters and Setters
                                2. Object Property Attributes
                                3. Protecting Objects: Freezing, Sealing, and Preventing Extension
                                4. Proxies
                                5. Conclusion
                                1. Online Documentation
                                2. Periodicals
                                3. Blogs and Tutorials
                                4. Stack Overflow
                                5. Contributing to Open Source Projects
                                6. Conclusion
                                1. Installing Git
                                2. Using Git

                                Product information

                                • Title: Learning JavaScript, 3rd Edition
                                • Author(s): Ethan Brown
                                • Release date: February 2016
                                • Publisher(s): O’Reilly Media, Inc.
                                • ISBN: 9781491914915

                                You might also like

                                Check it out now on O’Reilly

                                Dive in for free with a 10-day trial of the O’Reilly learning platform—then explore all the other resources our members count on to build skills and solve problems every day.

                                Источник

                                Learning JavaScript:Learning JavaScript: JavaScript Essentials for Modern Application Development. 2017. E. Brown

                                Even though this is my second book on technologies in the JavaScript ecosystem, I still find myself somewhat surprised at my role as a JavaScript expert and evangelist. Like so many programmers, I held a strong prejudice against JavaScript up until about 2012. To do such an about-face still feels a little disorienting.
                                My prejudice was for the usual reasons: I considered JavaScript a “toy” language (without really learning it properly, and therefore not knowing of what I spoke) that was practiced by dangerous, sloppy, untrained amateur programmers. There is a little truth in both of these reasons. ES6 was developed quickly, and even its inventor Bren‐ dan Eich admits there are things that he didn’t get right the first time around—and by the time he realized it, too many people were relying on the problematic behavior for him to effectively change it (show me the language that doesn’t suffer from this prob‐ lem, however). As for the second reason, JavaScript did make programming suddenly accessible. Not only did everyone have a browser, but with only a little effort, they could see the JavaScript that enabled the websites that were rapidly proliferating on the Web. People learned by trial and error, by reading each other’s code and—in so many cases—emulating poorly written code with insufficient understanding.
                                I’m glad I have learned enough about JavaScript to recognize that—far from being a toy language—it is based on extremely solid foundations, and is powerful, flexible, and expressive. I’m also glad I have come to embrace the accessibility that JavaScript brings. I certainly hold no animosity toward amateurs: everyone has to start some‐ where, programming is a profitable skill, and a career in programming has many advantages.
                                To the new programmer, the amateur, I say this: there is no shame in being an ama‐ teur. There is some shame in staying an amateur (if you make programming your profession, certainly). If you want to practice programming, practice it. Learn every‐ thing you can, from every source you can. Keep an open mind and—perhaps most importantly—question everything. Question every expert. Question every experi‐ enced programmer. Constantly ask “Why?”
                                For the most part, I have tried to keep this book to the “facts” of JavaScript, but it is impossible to completely avoid opinion. Where I offer opinions, take them for what they are. You are welcome to disagree, and you are encouraged to seek out the opin‐ ions of other experienced developers.
                                You are learning JavaScript at a very exciting time. The Web is leaving its infancy (technically speaking), and web development isn’t the confusing, complicated Wild West that it was 5 and 10 years ago. Standards like HTML5 and ES6 are making it easier to learn web development, and easier to develop high-quality applications. Node.js is extending the reach of JavaScript beyond the browser, and now it is a viable choice for system scripting, desktop application development, backend web develop‐ ment, and even embedded applications. Certainly I haven’t had this much fun pro‐ gramming since I started in the mid-1980s.

                                Источник

                                Читайте также:  Задачи на do while java
Оцените статью