The JavaScript Workshop Learn to Develop Interactive Web Applications with Clean and Maintainable JavaScript Code

The JavaScript Workshop is a definitive guide to learning JavaScript in a practical way. Starting with JavaScript's core syntax and structure, the book gradually builds up to more advanced concepts like server-side development and functional programming. With this book, you'll gain the con...

Celý popis

Uloženo v:
Podrobná bibliografie
Hlavní autoři: Labrecque, Joseph, Love, Jahred, Rosenbaum, Daniel, Turner, Nick, Mehla, Gaurav, L. Hosford, Alonzo, Sloot, Florian, Kirkbride, Philip
Médium: E-kniha
Jazyk:angličtina
Vydáno: Birmingham Packt Publishing, Limited 2019
Vydání:1
Témata:
ISBN:9781838641917, 1838641912
On-line přístup:Získat plný text
Tagy: Přidat tag
Žádné tagy, Buďte první, kdo vytvoří štítek k tomuto záznamu!
Obsah:
  • Writing and Invoking Functions -- Defining Functions -- Function Declaration -- Exercise 3.14: Writing a Function as a Statement and Invoking It -- Function Expression -- Exercise 3.15: Writing a Function as an Expression and Invoking It -- Arrow Function Expression -- Defining and Invoking an Arrow Function Expression -- Exercise 3.16: Writing an Arrow Function and Invoking It -- Reacting to User Input Events and Updating the DOM -- The DOM HTML Element Object -- Getting Access to Elements in the DOM -- Creating Elements and Content in the DOM -- DOM Events -- Exercise 3.17: Working with DOM Manipulation and Events -- Debugging -- Silent Fail -- Syntax Bugs -- Logic Bugs -- Debugging -- Debuggers -- Activity 3.01: The To-Do List Shuffle Program -- Summary -- Chapter 4: JavaScript Libraries and Frameworks -- Introduction -- Framework versus Library -- Vanilla.js -- Popular JavaScript Frameworks -- Everlasting jQuery -- Where to Find and How to Use External Code -- Exercise 4.01: Using a Third-Party Library in Your Code -- jQuery versus Vanilla.js -- Manipulating the DOM -- Making XHR Requests -- Exercise 4.02: Handling Click Events with jQuery -- Exercise 4.03: Handling the Same Event with Vanilla.js -- UI Animation Using jQuery -- Exercise 4.04: Animating a "Peek-a-boo" on Button Click -- Frameworks versus Core JavaScript -- Exercise 4.05: Rendering a List of To-Dos Using React -- Exercise 4.06: Rendering a List of To-Dos without a Library -- Exercise 4.07: Creating a Library Yourself -- Activity 4.01: Adding an Animation to the To-Do List Application -- Summary -- Chapter 5: Beyond the Fundamentals -- Introduction -- Creating Variables -- A Note on Referencing -- Global Assignment -- Declaring with var -- Declaring with let -- Declaring with const -- Exercise 5.01: Variables and Scope -- Identifying a Variable's Type
  • The Sources View -- The Network View -- HTML Element Manipulation with JavaScript -- Activity 2.01: Adding and Modifying an Item to/in the To-Do List -- Summary -- Chapter 3: Programming Fundamentals -- Introduction -- Data Types -- Representation of Data -- Literal Values -- Using Operators in Expressions -- Exercise 3.01: Implementing Expressions and Operators -- Using Variables and Constants in Expressions -- Exercise 3.02: Working with Variables Using the Web Browser Console -- Functions That Return Values -- Exercise 3.03: Using Functions in Expressions -- The Object Data Type -- Ready-Made Objects -- Exercise 3.04: Working with Ready-Made Objects -- Self-Made Objects -- Object Dot Notation -- The Array Object -- Using the Console Object -- Syntax -- Semicolon at the End of Code Statements -- Lines of Code versus Statements -- Comments -- Conditional and Loop Flow -- Code Blocks -- Conditional Flow Statements -- if...else Statement -- if Statement -- Exercise 3.05: Writing an if statement -- if Statement and else Statement -- Exercise 3.06: Writing an if...else Statement -- if Statements with Multiple else...if Statements -- if Statement, Multiple else...if statements, and the else Statement -- Exercise 3.07: Writing an if Statement with Multiple if else Statements and the else Statement -- The break Statement -- switch Statement -- Exercise 3.08: Writing a switch Statement and Testing It -- Loop Statements -- for Statement -- Exercise 3.09: Writing a for Loop and Testing It -- do...while Statement -- Exercise 3.10: Writing a do...while Loop and Testing It -- while Statement -- Exercise 3.11: Writing a while Loop and Testing It -- for...in Statement -- Exercise 3.12: Writing a for...in Loop and Testing It -- for...of Statement -- Exercise 3.13: Writing a for...of Loop and Testing It -- continue Statement -- Labeled Statement
  • Exercise 5.02: Evaluating Types from Variables -- Fixed Types -- The null Value -- The undefined Value -- Boolean Values -- Boolean Operators -- Comparison Operators -- Logical Operators -- Exercise 5.03: Odds and Evens -- Testing the Truth of Values -- The NOT Operator -- Boolean Operator Precedence -- Boolean Operator Associativity -- Exercise 5.04: Free Home Delivery Eligibility Validation -- Why You Shouldn't Compare Boolean and Non-Boolean Expressions -- Why You Shouldn't Chain Comparison Expressions -- The Ternary Operator -- Working with Numbers -- Arithmetic Limitations -- The Number Object -- Number Functions -- Number Methods -- Number Properties -- Exercise 5.05: Currency Formatter -- Working with Strings -- Special Characters -- Concatenation -- Template Literals -- Exercise 5.06: Email Templates -- The String Object -- The length Property -- String Methods -- Exercise 5.07: Sentence Reversal -- The toString Method -- Numbers with Strings -- Working with Functions -- Anonymous Functions -- Callbacks -- Exercise 5.08: Functional Parameters -- Arrow Functions -- Arrow Function Caveats -- Generator Functions -- The this Keyword -- The arguments Keyword -- Call and Apply -- Exercise 5.09: Dynamic Currying -- Activity 5.01: Simple Number Comparison -- Working with Objects -- Objects as Hashtables -- Object Keys and Memory -- Object and Pass-By Reference -- Object Iteration -- Object Accessors -- Exercise 5.10: Converting Objects to toString -- Working with Arrays -- Arrays and Mutability -- Array Iteration -- Built-In Array Functions -- Working with Dates -- Parsing Date Strings -- Formatting Dates into Strings -- Date Math -- Activity 5.02: Creating a To-Do Model -- Summary -- Chapter 6: Understanding Core Concepts -- Introduction -- Event Types -- Timer Events -- Exercise 6.01: Custom Timer -- Event Timers -- The setInterval Function
  • Cover -- FM -- Copyright -- Table of Contents -- Preface -- Chapter 1: Getting to Know JavaScript -- Introduction -- What Is JavaScript and How Is It Used? -- JavaScript versus Other Languages -- Exercise 1.01: Languages Discovery -- A Brief History of the JavaScript Language -- Netscape Mocha and LiveScript -- Sun Microsystems and Java -- Ecma International and ECMAScript -- Versions of ECMAScript (and JavaScript) -- ECMAScript 1 (1997) -- ECMAScript 2 (1998) -- ECMAScript 3 (1999) -- ECMAScript 4 (unreleased) -- ECMAScript 5 (2009) -- ECMAScript 6 (2015) -- ECMAScript 7 (2016), ECMAScript 8 (2017), and ECMAScript 9 (2018) -- Exercise 1.02: Can I Use This Feature? -- Accessing Web Browser Developer Tools -- Google Chrome -- Microsoft Edge -- Apple Safari -- An Introduction to Variables -- Exercise 1.03: Programming First Steps -- Activity 1.01: Creating an Alert Box Popup in the Web Browser -- Overview of JavaScript Capabilities -- Client-Side Form Validation -- JavaScript Widgets or Components -- XML HTTP Requests (XHR) -- Storing Local Data -- DOM Manipulation -- Animations and Effects -- Summary -- Chapter 2: Working with JavaScript -- Introduction -- Integrated Development Environments (IDE) -- GitHub's Atom -- Sublime Text -- Adobe Dreamweaver -- JetBrains WebStorm -- Microsoft Visual Studio Code -- JavaScript Project and File Management -- Project Folders and Files -- Exercise 2.01: Creating a Working Project Directory -- JavaScript Syntax and Structure -- Exercise 2.02: Creating Project Boilerplate -- Basic JavaScript Syntax -- JavaScript Execution Order -- Exercise 2.03: Verifying an Execution Order -- Overview of JavaScript Environments -- Browser-Based JavaScript -- Server-Based JavaScript -- Desktop JavaScript -- Mobile JavaScript -- A Closer Look at Web Browser Developer Tools -- The Elements View -- The Console View
  • The setTimeout Function -- Timer Parameters -- Exercise 6.02: Real-Time Clock -- The JavaScript Events Model -- Event Bubbling -- Traversing the Node Tree -- Direct Node Acquisition -- Assigning and Removing an Event Handler -- Exercise 6.03: Tabbed Content -- Bubbling versus Capturing -- The JavaScript Event Life Cycle -- Halting Event Propagation -- Halting Event Actions -- Exercise 6.04: Conditional Event Prevention -- Event Triggers -- Custom Events -- Native Event Triggers -- Event Hander Attributes -- Events and Memory -- Working with Forms -- HTTP -- The Form Tag -- Submitting a Form with JavaScript -- Form Submission Events -- Preventing Form Submission -- Resetting a Form -- Form Reset Event -- Exercise 6.05: Simple Form Handling -- Form Controls -- Input Controls -- The Button Control -- The Checkbox Control -- The Radio Control -- The Text Control -- The Password Control -- email, tel, and url Controls -- The Hidden Control -- The Number Control -- The Image Control -- The File Control -- The Textarea Control -- The Select Control -- Activity 6.01: Making Changes to the Model -- Summary -- Chapter 7: Popping the Hood -- Introduction -- JavaScript Execution and the Event Loop -- The JavaScript Runtime -- JavaScript Engine -- Environment APIs -- Message Queue -- Event Loop -- Call Stack -- Memory Heap -- Event Loop in Action -- Exercise 7.01: Working with the Event Loop -- Stack Overflow -- Exercise 7.02: Stack Overflow -- Memory Management -- The Garbage Collector -- Memory Leaks -- Event Listeners -- Detached DOM Nodes -- Global Variables -- Identifying Memory Leaks -- Exercise 7.03: Identifying Memory Leaks -- Exercise 7.04: Fixing the Memory Leak -- Activity 7.01: Finding out the Number of Stack Frames -- Summary -- Chapter 8: Browser APIs -- Introduction -- Canvas -- Exercise 8.01: Drawing Shapes Using Canvas Elements
  • Manipulate Shapes Using Path