Inhaltsverzeichnis

Alle Kapitel aufklappen
Alle Kapitel zuklappen
Preface
23
Target Audience
23
Structure of the Book
24
How Should I Read This Book?
24
Acknowledgments
24
1 Basics and Introduction
27
1.1 Programming Basics
27
1.1.1 Communicating with the Computer
27
1.1.2 Programming Languages
29
1.1.3 Tools for Program Design
36
1.2 Introduction to JavaScript
41
1.2.1 History
42
1.2.2 Fields of Application
43
1.3 Summary
49
2 Getting Started
51
2.1 Introduction to JavaScript and Web Development
51
2.1.1 The Relationships Among HTML, CSS, and JavaScript
51
2.1.2 The Right Tool for Development
55
2.2 Integrating JavaScript into a Web Page
58
2.2.1 Preparing a Suitable Folder Structure
59
2.2.2 Creating a JavaScript File
60
2.2.3 Embedding a JavaScript File in an HTML File
61
2.2.4 Defining JavaScript Directly Within the HTML
63
2.2.5 Placement and Execution of the <script> Elements
64
2.2.6 Displaying the Source Code
68
2.3 Creating Output
71
2.3.1 Showing the Standard Dialog
71
2.3.2 Writing to the Console
72
2.3.3 Using Existing User Interface Components
76
2.4 Summary
77
3 Language Core
79
3.1 Storing Values in Variables
79
3.1.1 Defining Variables
79
3.1.2 Using Valid Variable Names
82
3.1.3 Defining Constants
88
3.2 Using the Different Data Types
88
3.2.1 Numbers
89
3.2.2 Strings
92
3.2.3 Boolean Values
97
3.2.4 Arrays
97
3.2.5 Objects
102
3.2.6 Special Data Types
104
3.2.7 Symbols
105
3.3 Deploying the Different Operators
106
3.3.1 Operators for Working with Numbers
107
3.3.2 Operators for Easier Assignment
108
3.3.3 Operators for Working with Strings
109
3.3.4 Operators for Working with Boolean Values
111
3.3.5 Operators for Working with Bits
117
3.3.6 Operators for Comparing Values
119
3.3.7 The Optional Chaining Operator
121
3.3.8 The Logical Assignment Operators
123
3.3.9 Operators for Special Operations
125
3.4 Controlling the Flow of a Program
125
3.4.1 Defining Conditional Statements
126
3.4.2 Defining Branches
127
3.4.3 Using the Selection Operator
133
3.4.4 Defining Multiway Branches
135
3.4.5 Defining Counting Loops
141
3.4.6 Defining Head-Controlled Loops
148
3.4.7 Defining Tail-Controlled Loops
151
3.4.8 Prematurely Terminating Loops and Loop Iterations
152
3.5 Creating Reusable Code Blocks
161
3.5.1 Defining Functions
161
3.5.2 Calling Functions
164
3.5.3 Passing and Evaluating Function Parameters
164
3.5.4 Defining Return Values
173
3.5.5 Defining Default Values for Parameters
174
3.5.6 Using Elements from an Array as Parameters
176
3.5.7 Defining Functions Using Short Notation
178
3.5.8 Modifying Strings via Functions
180
3.5.9 Functions in Detail
181
3.5.10 Calling Functions Through User Interaction
189
3.6 Responding to Errors and Handling Them Correctly
190
3.6.1 Syntax Errors
190
3.6.2 Runtime Errors
191
3.6.3 Logic Errors
192
3.6.4 The Principle of Error Handling
193
3.6.5 Catching and Handling Errors
194
3.6.6 Triggering Errors
197
3.6.7 Errors and the Function Call Stack
201
3.6.8 Calling Certain Statements Regardless of Errors That Have Occurred
203
3.7 Commenting the Source Code
209
3.8 Debugging the Code
209
3.8.1 Introduction
210
3.8.2 A Simple Code Example
210
3.8.3 Defining Breakpoints
211
3.8.4 Viewing Variable Assignments
213
3.8.5 Running a Program Step by Step
214
3.8.6 Defining Multiple Breakpoints
216
3.8.7 Using Different Types of Breakpoints
216
3.8.8 Viewing the Function Call Stack
217
3.9 Summary
219
4 Working with Reference Types
221
4.1 Differences Between Primitive Data Types and Reference Types
221
4.1.1 The Principle of Primitive Data Types
221
4.1.2 The Principle of Reference Types
222
4.1.3 Primitive Data Types and Reference Types as Function Arguments
224
4.1.4 Determining the Type of a Variable
225
4.1.5 Outlook
228
4.2 Encapsulating State and Behavior in Objects
228
4.2.1 Introduction to Object-Oriented Programming
228
4.2.2 Creating Objects Using Literal Notation
229
4.2.3 Creating Objects via Constructor Functions
231
4.2.4 Creating Objects Using Classes
234
4.2.5 Creating Objects via the Object.create() Function
237
4.2.6 Accessing Properties and Calling Methods
241
4.2.7 Adding or Overwriting Object Properties and Object Methods
247
4.2.8 Deleting Object Properties and Object Methods
251
4.2.9 Outputting Object Properties and Object Methods
253
4.2.10 Using Symbols to Define Unique Object Properties
256
4.2.11 Preventing Changes to Objects
258
4.3 Working with Arrays
261
4.3.1 Creating and Initializing Arrays
261
4.3.2 Accessing Elements of an Array
265
4.3.3 Adding Elements to an Array
266
4.3.4 Removing Elements from an Array
271
4.3.5 Copying Only Some Elements from an Array
274
4.3.6 Sorting Arrays
276
4.3.7 Using Arrays as a Stack
279
4.3.8 Using Arrays as a Queue
280
4.3.9 Finding Elements in Arrays
282
4.3.10 Copying Elements Within an Array
284
4.3.11 Converting Arrays to Strings
285
4.4 Extracting Values from Arrays and Objects
286
4.4.1 Extracting Values from Arrays
286
4.4.2 Extracting Values from Objects
290
4.4.3 Extracting Values Within a Loop
293
4.4.4 Extracting Arguments of a Function
294
4.4.5 Copying Object Properties to Another Object
296
4.4.6 Copying Object Properties from Another Object
297
4.5 Working with Strings
298
4.5.1 The Structure of a String
298
4.5.2 Determining the Length of a String
298
4.5.3 Searching Within a String
299
4.5.4 Extracting Parts of a String
302
4.6 Using Maps
305
4.6.1 Creating Maps
305
4.6.2 Basic Operations
307
4.6.3 Iterating over Maps
308
4.6.4 Using Weak Maps
310
4.7 Using Sets
312
4.7.1 Creating Sets
312
4.7.2 Basic Operations of Sets
313
4.7.3 Iterating over Sets
314
4.7.4 Using Weak Sets
315
4.8 Other Global Objects
316
4.8.1 Working with Date and Time Information
316
4.8.2 Performing Complex Calculations
319
4.8.3 Wrapper Objects for Primitive Data Types
320
4.9 Working with Regular Expressions
320
4.9.1 Defining Regular Expressions
320
4.9.2 Testing Characters Strings Against a Regular Expression
321
4.9.3 Using Character Classes
323
4.9.4 Limiting Beginning and End
327
4.9.5 Using Quantifiers
330
4.9.6 Searching for Occurrences
334
4.9.7 Searching All Occurrences Within a String
335
4.9.8 Accessing Individual Parts of an Occurrence
336
4.9.9 Searching for Specific Strings
337
4.9.10 Replacing Occurrences Within a String
337
4.9.11 Searching for Occurrences
338
4.9.12 Splitting Strings
339
4.10 Functions as Reference Types
339
4.10.1 Using Functions as Arguments
339
4.10.2 Using Functions as Return Values
342
4.10.3 Standard Methods of Each Function
343
4.11 Summary
347
5 Dynamically Changing Web Pages
349
5.1 Structure of a Web Page
349
5.1.1 Document Object Model
349
5.1.2 The Different Types of Nodes
350
5.1.3 The Document Node
353
5.2 Selecting Elements
355
5.2.1 Selecting Elements by ID
356
5.2.2 Selecting Elements by Class
359
5.2.3 Selecting Elements by Element Name
362
5.2.4 Selecting Elements by Name
364
5.2.5 Selecting Elements by Selector
365
5.2.6 Selecting the Parent Element of an Element
370
5.2.7 Selecting the Child Elements of an Element
373
5.2.8 Selecting the Sibling Elements of an Element
377
5.2.9 Calling Selection Methods on Elements
379
5.2.10 Selecting Elements by Type
382
5.3 Working with Text Nodes
382
5.3.1 Accessing the Text Content of an Element
383
5.3.2 Modifying the Text Content of an Element
384
5.3.3 Modifying the HTML Below an Element
384
5.3.4 Creating and Adding Text Nodes
385
5.4 Working with Elements
386
5.4.1 Creating and Adding Elements
386
5.4.2 Removing Elements and Nodes
389
5.4.3 Various Types of HTML Elements
390
5.5 Working with Attributes
395
5.5.1 Reading the Value of an Attribute
395
5.5.2 Changing the Value of an Attribute or Adding a New Attribute
397
5.5.3 Creating and Adding Attribute Nodes
398
5.5.4 Removing Attributes
398
5.5.5 Accessing CSS Classes
398
5.6 Summary
399
6 Processing and Triggering Events
401
6.1 The Concept of Event-Driven Programming
401
6.2 Responding to Events
402
6.2.1 Defining an Event Handler via HTML
404
6.2.2 Defining an Event Handler via JavaScript
406
6.2.3 Defining Event Listeners
408
6.2.4 Defining Multiple Event Listeners
410
6.2.5 Passing Arguments to Event Listeners
411
6.2.6 Removing Event Listeners
413
6.2.7 Defining Event Handlers and Event Listeners via a Helper Function
414
6.2.8 Accessing Information of an Event
416
6.3 The Different Types of Events
418
6.3.1 Events When Interacting with the Mouse
419
6.3.2 Events During Interactions with the Keyboard
423
6.3.3 Events When Working with Forms
425
6.3.4 Events When Focusing Elements
425
6.3.5 General Events of the User Interface
426
6.3.6 Events on Mobile Devices
429
6.4 Understanding and Influencing the Flow of Events
430
6.4.1 The Event Phases
430
6.4.2 Interrupting the Event Flow
437
6.4.3 Preventing Default Actions of Events
442
6.5 Programmatically Triggering Events
444
6.5.1 Triggering Simple Events
444
6.5.2 Triggering Events with Passed Arguments
445
6.5.3 Triggering Default Events
446
6.6 Summary
447
7 Working with Forms
449
7.1 Accessing Forms and Form Fields
449
7.1.1 Accessing Forms
449
7.1.2 Accessing Form Elements
453
7.1.3 Reading the Value of Text Fields and Password Fields
454
7.1.4 Reading the Value of Checkboxes
456
7.1.5 Reading the Value of Radio Buttons
456
7.1.6 Reading the Value of Selection Lists
458
7.1.7 Reading the Values of Multiple Selection Lists
459
7.1.8 Populating Selection Lists with Values Using JavaScript
461
7.2 Programmatically Submitting and Resetting Forms
462
7.3 Validating Form Inputs
464
7.4 Summary
474
8 Controlling Browsers and Reading Browser Information
475
8.1 The Browser Object Model
475
8.2 Accessing Window Information
477
8.2.1 Determining the Size and Position of a Browser Window
477
8.2.2 Changing the Size and Position of a Browser Window
478
8.2.3 Accessing Display Information of the Browser Bars
480
8.2.4 Determining General Properties
481
8.2.5 Opening New Browser Windows
482
8.2.6 Closing the Browser Window
483
8.2.7 Opening Dialogs
484
8.2.8 Executing Functions in a Time-Controlled Manner
485
8.3 Accessing Navigation Information of a Currently Open Web Page
487
8.3.1 Accessing the Individual Components of the URL
488
8.3.2 Accessing Query String Parameters
489
8.3.3 Loading a New Web Page
489
8.4 Viewing and Modifying the Browsing History
490
8.4.1 Navigating the Browsing History
490
8.4.2 Browsing History for Single-Page Applications
491
8.4.3 Adding Entries to the Browsing History
492
8.4.4 Responding to Changes in the Browsing History
495
8.4.5 Replacing the Current Entry in the Browsing History
495
8.5 Recognizing Browsers and Determining Browser Features
496
8.6 Accessing Screen Information
499
8.7 Summary
500
9 Dynamically Reloading Contents of a Web Page
501
9.1 The Principle of Ajax
501
9.1.1 Synchronous Communication
501
9.1.2 Asynchronous Communication
502
9.1.3 Typical Use Cases for Ajax
504
9.1.4 Data Formats Used
506
9.2 The XML Format
507
9.2.1 The Structure of XML
507
9.2.2 XML and the Document Object Model API
509
9.2.3 Converting Strings to XML Objects
509
9.2.4 Converting XML Objects to Strings
511
9.3 The JSON Format
512
9.3.1 The Structure of JSON
512
9.3.2 Difference Between JSON and JavaScript Objects
514
9.3.3 Converting Objects to JSON Format
515
9.3.4 Converting Objects from JSON Format
516
9.4 Making Requests via Ajax
517
9.4.1 The XMLHttpRequest Object
517
9.4.2 Loading HTML Data via Ajax
523
9.4.3 Loading XML Data via Ajax
527
9.4.4 Loading JSON Data via Ajax
531
9.4.5 Sending Data to the Server via Ajax
533
9.4.6 Submitting Dorms via Ajax
534
9.4.7 Loading Data from Other Domains
535
9.4.8 The Newer Alternative to XMLHttpRequest: The Fetch API
538
9.5 Summary
542
10 Simplifying Tasks with jQuery
543
10.1 Introduction
543
10.1.1 Embedding jQuery
544
10.1.2 Embedding jQuery via a Content Delivery Network
545
10.1.3 Using jQuery
546
10.1.4 Simplifying Tasks with jQuery
547
10.2 Working with the DOM
548
10.2.1 Selecting Elements
549
10.2.2 Accessing and Modifying Content
554
10.2.3 Filtering Selected Elements
557
10.2.4 Accessing Attributes
559
10.2.5 Accessing CSS Properties
560
10.2.6 Navigating Between Elements
561
10.2.7 Using Effects and Animations
563
10.3 Responding to Events
565
10.3.1 Registering Event Listeners
565
10.3.2 Responding to General Events
566
10.3.3 Responding to Mouse Events
566
10.3.4 Responding to Keyboard Events
567
10.3.5 Responding to Form Events
568
10.3.6 Accessing Information from Events
569
10.4 Creating Ajax Requests
572
10.4.1 Creating Ajax Requests
572
10.4.2 Responding to Events
574
10.4.3 Loading HTML Data via Ajax
576
10.4.4 Loading XML Data via Ajax
577
10.4.5 Loading JSON Data via Ajax
578
10.5 Summary
579
11 Dynamically Creating Images and Graphics
585
11.1 Drawing Images
585
11.1.1 The Drawing Area
585
11.1.2 The Rendering Context
586
11.1.3 Drawing Rectangles
588
11.1.4 Using Paths
590
11.1.5 Drawing Texts
596
11.1.6 Drawing Gradients
597
11.1.7 Saving and Restoring the Canvas State
599
11.1.8 Using Transformations
601
11.1.9 Creating Animations
604
11.2 Integrating Vector Graphics
606
11.2.1 The SVG Format
606
11.2.2 Integrating SVG in HTML
607
11.2.3 Changing the Appearance of SVG Elements with CSS
610
11.2.4 Manipulating the Behavior of SVG Elements via JavaScript
611
11.3 Summary
613
12 Using Modern Web APIs
615
12.1 Communicating via JavaScript
616
12.1.1 Unidirectional Communication with the Server
617
12.1.2 Bidirectional Communication with a Server
618
12.1.3 Outgoing Communication from the Server
620
12.2 Recognizing Users
625
12.2.1 Using Cookies
625
12.2.2 Creating Cookies
627
12.2.3 Reading Cookies
628
12.2.4 Example: Shopping Cart Based on Cookies
630
12.2.5 Disadvantages of Cookies
633
12.3 Using the Browser Storage
633
12.3.1 Storing Values in the Browser Storage
634
12.3.2 Reading Values from the Browser Storage
635
12.3.3 Updating Values in the Browser Storage
636
12.3.4 Deleting Values from the Browser Storage
636
12.3.5 Responding to Changes in the Browser Storage
636
12.3.6 Various Types of Browser Storage
637
12.3.7 Example: Shopping Cart Based on the Browser Storage
639
12.4 Using the Browser Database
640
12.4.1 Opening a Database
641
12.4.2 Creating a Database
642
12.4.3 Creating an Object Store
643
12.4.4 Adding Objects to an Object Store
643
12.4.5 Reading Objects from an Object Store
647
12.4.6 Deleting Objects from an Object Store
648
12.4.7 Updating Objects in an Object Store
649
12.4.8 Using a Cursor
650
12.5 Accessing the File System
651
12.5.1 Selecting Files via File Dialog
652
12.5.2 Selecting Files via Drag and Drop
653
12.5.3 Reading Files
654
12.5.4 Monitoring the Reading Progress
657
12.6 Moving Components of a Web Page with Drag and Drop
659
12.6.1 Events of a Drag-and-Drop Operation
659
12.6.2 Defining Movable Elements
660
12.6.3 Moving Elements
663
12.7 Parallelizing Tasks
664
12.7.1 The Principle of Web Workers
665
12.7.2 Using Web Workers
666
12.8 Determining the Location of Users
668
12.8.1 Accessing Location Information
668
12.8.2 Continuously Accessing Location Information
670
12.9 Reading the Battery Level of an End Device
671
12.9.1 Accessing Battery Information
671
12.9.2 Responding to Events
672
12.10 Outputting Speech and Recognizing Speech
674
12.10.1 Outputting Speech
675
12.10.2 Recognizing Speech
677
12.11 Creating Animations
678
12.11.1 Using the API
679
12.11.2 Controlling an Animation
682
12.12 Working with the Command Line
682
12.12.1 Selecting and Inspecting DOM Elements
684
12.12.2 Events Analysis
687
12.12.3 Debugging, Monitoring, and Profiling
687
12.13 Developing Multilingual Applications
691
12.13.1 Explanation of Terms
692
12.13.2 The Internationalization API
693
12.13.3 Comparing Character String Expressions
695
12.13.4 Formatting Dates and Times
697
12.13.5 Formatting Numeric Values
700
12.14 Overview of Various Web APIs
703
12.15 Summary
707
13 Object-Oriented Programming
709
13.1 The Principles of Object-Oriented Programming
709
13.1.1 Classes, Object Instances, and Prototypes
710
13.1.2 Principle 1: Define Abstract Behavior
712
13.1.3 Principle 2: Encapsulate Condition and Behavior
712
13.1.4 Principle 3: Inherit Condition and Behavior
713
13.1.5 Principle 4: Accept Different Types
714
13.1.6 JavaScript and Object Orientation
715
13.2 Prototypical Object Orientation
715
13.2.1 The Concept of Prototypes
715
13.2.2 Deriving from Objects
716
13.2.3 Inheriting Methods and Properties
717
13.2.4 Defining Methods and Properties in the Inheriting Object
717
13.2.5 Overwriting Methods
718
13.2.6 The Prototype Chain
719
13.2.7 Calling Methods of the Prototype
721
13.2.8 Prototypical Object Orientation and the Principles of Object Orientation
721
13.3 Pseudoclassical Object Orientation
722
13.3.1 Defining Constructor Functions
722
13.3.2 Creating Object Instances
722
13.3.3 Defining Methods
722
13.3.4 Inheritance with Prototypes
723
13.3.5 Calling the Constructor of the “Superclass”
727
13.3.6 Overwriting Methods
727
13.3.7 Calling Methods of the “Superclass”
727
13.3.8 Pseudoclassical Object Orientation and the Principles of Object Orientation
728
13.4 Object Orientation with Class Syntax
728
13.4.1 Defining Classes
728
13.4.2 Creating Object Instances
730
13.4.3 Defining Getters and Setters
731
13.4.4 Defining Private Properties and Private Methods
732
13.4.5 Deriving from “Classes”
736
13.4.6 Overwriting Methods
740
13.4.7 Calling Methods of the “Superclass”
742
13.4.8 Defining Static Methods
743
13.4.9 Defining Static Properties
745
13.4.10 Class Syntax and the Principles of Object Orientation
747
13.5 Summary
747
14 Functional Programming
749
14.1 Principles of Functional Programming
749
14.2 Imperative Programming and Functional Programming
751
14.2.1 Iterating with the forEach() Method
751
14.2.2 Mapping Values with the map() Method
754
14.2.3 Filtering Values with the filter() Method
755
14.2.4 Reducing Multiple Values to One Value with the reduce() Method
756
14.2.5 Combination of the Different Methods
759
14.3 Summary
760
15 Correctly Structuring the Source Code
763
15.1 Avoiding Name Conflicts
763
15.2 Defining and Using Modules
767
15.2.1 The Module Design Pattern
767
15.2.2 The Revealing Module Design Pattern
770
15.2.3 Asynchronous Model Definition
774
15.2.4 CommonJS
776
15.2.5 Native Modules
777
15.3 Summary
781
16 Using Asynchronous Programming and Other Advanced Features
783
16.1 Understanding and Using Asynchronous Programming
783
16.1.1 Using the Callback Design Pattern
783
16.1.2 Using Promises
788
16.1.3 Using Async Functions
796
16.2 Encapsulating Iteration over Data Structures
800
16.2.1 The Principle of Iterators
800
16.2.2 Using Iterators
800
16.2.3 Creating Your Own Iterator
801
16.2.4 Creating an Iterable Object
802
16.2.5 Iterating over Iterable Objects
804
16.3 Pausing and Resuming Functions
804
16.3.1 Creating a Generator Function
804
16.3.2 Creating a Generator
805
16.3.3 Iterating over Generators
805
16.3.4 Creating Infinite Generators
806
16.3.5 Controlling Generators with Parameters
807
16.4 Intercepting Access to Objects
807
16.4.1 The Principle of Proxies
808
16.4.2 Creating Proxies
808
16.4.3 Defining Handlers for Proxies
808
16.5 Summary
812
17 Creating Server-Based Applications with Node.js
815
17.1 Introduction to Node.js
815
17.1.1 The Architecture of Node.js
815
17.1.2 Installing Node.js
817
17.1.3 A Simple Application
817
17.2 Managing Node.js Packages
818
17.2.1 Installing the Node.js Package Manager
818
17.2.2 Installing Packages
818
17.2.3 Initializing Your Own Packages
821
17.3 Processing and Triggering Events
825
17.3.1 Triggering and Intercepting an Event
825
17.3.2 Triggering an Event Multiple Times
827
17.3.3 Responding to an Event Exactly Once
827
17.3.4 Registering Multiple Event Listeners for an Event
828
17.4 Accessing the File System
829
17.4.1 Reading Files
829
17.4.2 Writing Files
830
17.4.3 Reading File Information
831
17.4.4 Deleting Files
832
17.4.5 Working with Directories
832
17.5 Creating a Web Server
833
17.5.1 Starting a Web Server
833
17.5.2 Making Files Available via Web Server
834
17.5.3 Creating a Client for a Web Server
835
17.5.4 Defining Routes
836
17.5.5 Using the Express.js Web Framework
837
17.6 Accessing Databases
842
17.6.1 Installing MongoDB
842
17.6.2 Installing a MongoDB Driver for Node.js
842
17.6.3 Establishing a Connection to the Database
843
17.6.4 Creating a Collection
843
17.6.5 Saving Objects
844
17.6.6 Reading Objects
845
17.6.7 Updating Objects
847
17.6.8 Deleting Objects
848
17.7 Working with Streams
849
17.7.1 Introduction and Types of Streams
849
17.7.2 Stream Use Cases
850
17.7.3 Reading Data with Streams
851
17.7.4 Writing Data with Streams
852
17.7.5 Combining Streams Using Piping
854
17.7.6 Error Handling During Piping
856
17.8 Summary
857
18 Creating Mobile Applications with JavaScript
859
18.1 The Different Types of Mobile Applications
859
18.1.1 Native Applications
859
18.1.2 Mobile Web Applications
860
18.1.3 Hybrid Applications
862
18.1.4 Comparison of the Different Approaches
863
18.2 Creating Mobile Applications with React Native
865
18.2.1 The Principle of React Native
865
18.2.2 Installation and Project Initialization
865
18.2.3 Starting the Application
868
18.2.4 The Basic Structure of a React Native Application
871
18.2.5 Using UI Components
872
18.2.6 Communication with the Server
877
18.2.7 Building and Publishing Applications
878
18.3 Summary
878
19 AI Applications with JavaScript
879
19.1 Basics and Concepts
880
19.1.1 How Does an LLM Work?
881
19.1.2 Tokens as an LLM Currency
882
19.2 Working with LLMs on the Server
884
19.2.1 Preparation: Installing the Local LLM
886
19.2.2 Communicating with the LLM via Libraries
887
19.2.3 Communicating Directly with an LLM via the REST Interface
891
19.3 Practical Application of LLMs
895
19.3.1 Chatbot with JavaScript
895
19.3.2 Image Recognition with TensorFlow.js
901
19.4 LangChain Architecture Framework for AI Applications
908
19.4.1 Our First Chain with LangChain
908
19.5 Summary
915
20 Setting up a Professional Development Process
917
20.1 Automating the Workflow
917
20.1.1 Overview: Modern Tools for Automation
917
20.1.2 Checking Code Quality with ESLint
920
20.1.3 Automated Source Code Testing with Vitest
923
20.1.4 Bundling and Optimizing Source Code with esbuild
934
20.1.5 Interaction in the npm Workflow
938
20.2 Version Control of the Source Code
939
20.2.1 Introduction to Version Control
939
20.2.2 Installing and Configuring the Git Version Control System
943
20.2.3 Creating a New Local Repository
943
20.2.4 Cloning an Existing Repository
944
20.2.5 Transferring Changes to the Staging Area
944
20.2.6 Transfer Changes to the Local Repository
945
20.2.7 The Different States in Git
946
20.2.8 Transferring Changes to the Remote Repository
947
20.2.9 Transferring Changes from the Remote Repository
948
20.2.10 Working in a New Branch
949
20.2.11 Applying Changes from a Branch
951
20.2.12 The Most Important Commands and Terms
951
20.3 Summary
955
The Author
957
Index
959