Hands-on JavaScript for Python Developers
- FREE Subscribe Access now
- $39.99 Print + eBook Buy
- $27.99 eBook Buy
- Instant online access to over 7,500+ books and videos
- Constantly updated with 100+ new titles each month
- Breadth and depth in over 1,000+ technologies
-
Section 1 - What is JavaScript? What is it not?
-
The Entrance of JavaScript into Mainstream Programming
- The Entrance of JavaScript into Mainstream Programming
- Technical requirements
- NCSA and the need for interactivity
- Early web browsers and a 10-day prototype
- Enter Ecma International
- HTML, CSS, and JavaScript – the best friends of the frontend
- HTML, the overlooked hero
- CSS
- JavaScript
- How JavaScript fits into the frontend ecosystem
- Our first Ajax application
- JavaScript in practice
- Summary
- Questions
- Further reading
-
Can We Use JavaScript Server-Side? Sure!
- Can We Use JavaScript Server-Side? Sure!
- Technical requirements
- Why use JavaScript on the server side?
- Grammatical similarities
- A bit more history
- The Node.js ecosystem
- Node.js
- npm
- Express.js
- Threading and asynchronicity
- Traditional client-server architecture
- Node.js architecture
- Summary
- Questions
- Further reading
-
Nitty-Gritty Grammar
- Nitty-Gritty Grammar
- Technical requirements
- A history of style
- Grammar rules
- Capitalization counts
- Reserved words
- Declaring variables
- const
- let
- var
- Data types
- typeof and equality
- Arrays and objects
- Conditionals
- Loops
- for loops
- while loops
- do/while loops
- for..in loops
- for..of loops
- Functions
- Function declarations
- Function expressions
- Arrow functions
- Comments
- Methods and properties
- Punctuation and readability
- The elephant in the room – whitespace
- Existing standards – linting to the rescue!
- Summary
- Questions
- Further reading
-
Data and Your Friend, JSON
- Data and Your Friend, JSON
- Technical requirements
- Data types – both JavaScript and Python are dynamically typed!
- Exploring data types
- Booleans
- Numbers
- Strings
- Exercise – a basic calculator
- Arrays and sets
- Arrays
- Sets
- Objects and JSON
- Prototypal inheritance
- JSON
- The HTTP verbs
- API calls from the frontend – Ajax
- SWAPI lab
- Summary
- Questions
- Further reading
-
Section 2 - Using JavaScript on the Front-End
-
Hello World! and Beyond: Your First Application
- Hello World! and Beyond: Your First Application
- Technical requirements
- I/O with the console and alert messages
- Working with input in a function
- Exercise – Fibonacci sequence
- Fibonacci sequence solution
- Using objects as a datastore
- Exercise – multiplication
- Multiplication solution
- Step 1 – computing and storing
- Step 2 – retrieval
- Understanding scope
- Scope chains and scope trees
- Closures
- A basic example of a closure in practice
- Summary
- Questions
- Further reading
-
The Document Object Model (DOM)
-
Events, Event-Driven Design, and APIs
- Events, Event-Driven Design, and APIs
- Technical requirements
- The event life cycle
- Capturing an event and reading its properties
- Sticky notes revisited
- Sticky notes – solution 1
- Sticky notes – solution 2 – event delegation
- Sticky notes – solution 3
- Using Ajax and events to populate API data
- Starter code
- Custom events
- Solution code
- Handling asynchronicity
- Error handling
- Star Wars API exploration Lab
- A solution
- Summary
- Questions
- Further reading
-
Working with Frameworks and Libraries
- Working with Frameworks and Libraries
- Technical requirements
- jQuery
- Advantages of jQuery
- Disadvantages of jQuery
- Examples of jQuery
- Angular
- Advantages of Angular
- Disadvantages of Angular
- Examples of Angular
- Single-page applications
- The JavaScript
- React and React Native
- Advantages of React
- Disadvantages of React
- Example of React
- Components
- React Native
- Vue.js
- Features of Vue.js
- Example of Vue.js
- Summary
- Further reading
-
Deciphering Error Messages and Performance Leaks
-
JavaScript, Ruler of the Frontend
-
Section 3 - The Back-End: Node.js vs. Python
-
What Is Node.js?
-
Node.js versus Python
-
Using Express
-
React with Django
-
Combining Node.js with the Frontend
- Combining Node.js with the Frontend
- Technical requirements
- Understanding the architecture handshake
- The frontend and Node.js - React and image upload
- Architecture
- Investigating the React JSX
- Deciphering the Express application
- Creating a recipe book with APIs and JSON
- Setting up the application
- Testing the API
- Diving into the code
- Making a restaurant database with Yelp and Firebase
- The starting line - creating a React app
- Getting set up with Firebase
- Testing our database
- Creating our app
- Summary
-
Enter Webpack
-
Section 4 - Communicating with Databases
-
Security and Keys
-
Node.js and MongoDB
-
Putting It All Together
-
Assessments
-
Other Books You May Enjoy
About this book
Knowledge of Python is a great foundation for learning other languages. This book will help you advance in your software engineering career by leveraging your Python programming skills to learn JavaScript and apply its unique features not only for frontend web development but also for streamlining work on the backend.
Starting with the basics of JavaScript, you’ll cover its syntax, its use in the browser, and its frameworks and libraries. From working with user interactions and ingesting data from APIs through to creating APIs with Node.js, this book will help you get up and running with JavaScript using hands-on exercises, code snippets, and detailed descriptions of JavaScript implementation and benefits. To understand the use of JavaScript in the backend, you’ll explore Node.js and discover how it communicates with databases. As you advance, you’ll get to grips with creating your own RESTful APIs and connecting the frontend and backend for holistic full-stack development knowledge.
By the end of this Python JavaScript book, you’ll have the knowledge you need to write full-fledged web applications from start to finish. You’ll have also gained hands-on experience of working through several projects, which will help you advance in your career as a JavaScript developer.
- Publication date:
- September 2020
- Publisher
- Packt
- Pages
- 410
- ISBN
- 9781838648121