Skip to content

Welcome to the JavaScript-For-Beginners repository! This repository is designed to help beginners learn the basics of JavaScript through examples and exercises.

Notifications You must be signed in to change notification settings

MashoodAli-Official/JavaScript-For-Beginners

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaScript-For-Beginners

Welcome to the JavaScript-For-Beginners repository! This repository is designed to help beginners learn the basics of JavaScript through examples and exercises.

Download and Clone the Repository 📥

You can download or clone this repository to start working with it. Here are two methods you can use:

  1. Using GitHub CLI 🚀 If you have the GitHub CLI installed, you can clone this repository using the following command:
gh repo clone MashoodAli-Official/JavaScript-For-Beginners
  1. Using HTTPS 🔗 If you prefer using HTTPS, use this command:
https://github.com/MashoodAli-Official/JavaScript-For-Beginners.git
  1. After cloning the repository, navigate to the project directory:
cd JavaScript-For-Beginners

Ch.01 Introduction To JavaScript

This chapter covers the fundamental concepts of JavaScript. Below is a list of topics included in this chapter:

  • 01 ConsoleLog
  • 02 Comments
  • 03 Data Types
  • 04 Arithmetic Operator
  • 05 String Concatenation
  • 06 Methods
  • 07 Built In Methods

Ch.02 Variables in JavaScript

In this chapter, we'll explore variables - one of the most fundamental concepts in JavaScript. Variables are containers that store data values. You'll learn about different ways to declare variables using var, let, and const, understand variable scope, and learn best practices for naming and using variables in your JavaScript code.

  • 01 Variables
  • 02 Let Variables
  • 03 Const Variables
  • 04 Arithmetic Operator
  • 05 Assignment Operators
  • 06 String Concatenation
  • 07 String Interpolation
  • 08 Type Of Operator
  • 09 String Properties

Ch.03 Conditional Statements / Control Flow

Control the flow of your JavaScript programs with conditional statements. Learn how to make decisions in code using if/else statements, comparison and logical operators, and switch statements.

  • 01 If Statement
  • 02 If-Else Statement
  • 03 Comparison Operators
  • 04 Logical Operators
  • 05 Truthy and falsy operator
  • 06 Ternary operator
  • 07 If else if statement
  • 08 Switch Keyword Statement

Ch.04 Functions

Functions are reusable blocks of code that perform specific tasks. This chapter covers everything from basic function declarations to advanced concepts like higher-order functions. You'll learn how to create and call functions, work with parameters and arguments, use default parameters, understand the return keyword, create helper functions, work with anonymous and arrow functions, and explore higher-order functions that can take other functions as arguments or return them as values. By the end of this chapter, you'll have a solid foundation in JavaScript function concepts and patterns.

  • 01 Function Declaration and Calling
  • 02 Function Parameter and Argument
  • 03 Function Default Parameter
  • 04 Return keyword in Function
  • 05 Helper Function
  • 06 Anonymous Function
  • 07 Arrow Function
  • 08 Refactor Arrow Function
  • 09 Higher Order Function

Ch.05 Scope

In this chapter, we'll delve into the concept of scope, a fundamental aspect of programming that determines the accessibility and visibility of variables within a program.

  • 01 Block And Scope
  • 02 Global Scope
  • 03 Block Scope
  • 04 Scope Pollution

Ch.06 Arrays

Arrays are ordered collections that can store multiple values of any type. This chapter covers array fundamentals in JavaScript - from creating and accessing elements to manipulating array data using built-in methods. You'll learn array basics, element access/updates, variable declarations with arrays, key array properties/methods, and how to work with nested arrays.

  • 01 Arrays Introduction
  • 02 Arrays Elements Accessing
  • 03 Update ARray Elements
  • 04 Let Const In Arrays
  • 05 Array Properties and Methods
  • 06 Nested Array

Ch.07 Loops

Loops are fundamental programming constructs that allow you to execute a block of code repeatedly. This chapter covers different types of loops in JavaScript, including for loops, while loops, and do-while loops. You'll learn how to iterate over arrays, create nested loops, and control loop execution flow. Understanding loops is essential for efficient programming and working with data structures.

  • 01 Introduction to Loop
  • 02 For Loop
  • 03 Backward For Loop
  • 04 Loops in Arrays
  • 05 Nested Loops
  • 06 While Loop
  • 07 Do While Loop

Ch.08 High Order Function

Higher-order functions are functions that can take other functions as parameters and/or return functions as output. This chapter explores the powerful concept of treating functions as first-class citizens in JavaScript - allowing functions to be assigned to variables, passed as arguments, and returned from other functions.

  • 01 Intro High order function
  • 02 Function as Data
  • 03 Functions As Parameters

Ch.09 Iterators

Iterators are built-in array methods that make it easier to manipulate and transform data in arrays. This chapter covers essential iterator methods like forEach() for executing code on each element, map() for transforming elements, filter() for selecting elements that match criteria, and findIndex() for locating specific elements. These methods provide cleaner alternatives to traditional for loops when working with arrays.

  • 01 Introduction to Iterators
  • 02 For() Each Method
  • 03 Map() Method
  • 04 Filter() Method
  • 05 Find Index() Method

Ch.10 Objects

In this chapter, you will learn about JavaScript objects, which are collections of key-value pairs. You will explore how to create objects using literal notation, access and modify their properties, and understand the difference between dot and bracket notation. Additionally, you will learn about object methods, nested objects, and how objects are passed by reference. Finally, you will discover how to loop through objects to access their properties and values.

  • 01 Introducntion to Object
  • 02 Object literal declaration
  • 03 Accessing the Object Properties (using Dot & bracket notation)
  • 04 Property Assignment
  • 05 Object Methods
  • 06 Nested Object
  • 07 Object Pass by Reference
  • 08 Looping Through Object

Ch.11 Advanced Object

This chapter delves into advanced concepts related to objects in programming, covering topics such as:

  • 01 Introduction to Advanced Object
  • 02 This keyword through Object
  • 03 Arrow Function and This keyword
  • 04 Getters Method
  • 05 Setters Method
  • 06 Factory Functions in Objects
  • 07 Property value shorthand in objects using factory function
  • 08 Destructured Assignment
  • 09 Built-In Object Methods

Ch.12 Classes

In this chapter, we'll dive into the world of classes in JavaScript. You'll learn how to create and work with classes, including constructors, instances, methods, inheritance, and static methods. By the end of this chapter, you'll have a solid grasp of the basics of object-oriented programming in JavaScript, giving you the skills to build robust, reusable code.

  • 01 Introduction to Classes
  • 02 Constructor in Classes
  • 03 Instance
  • 04 Methods in Classes
  • 05 Inheritance in JavaScript
  • 06 Static method in classes

Ch.13 Modules

Modules in JavaScript allow you to organize code into reusable, self-contained files. They encapsulate functionality, avoid global namespace pollution, and promote maintainability. Using import and export, modules enable code reuse and better structure, essential for modern development in frameworks like React, Angular, and Node.js.

  • 01 Basic Introduction to Modules
  • 02 Practice Modules Exercise

Ch.14 Promises

Promises in JavaScript simplify handling asynchronous operations like API calls or timers, replacing the complexity of callbacks. A Promise represents the eventual success or failure of an async task, making code more readable and maintainable. This chapter covers creating, consuming, and chaining Promises, along with advanced techniques like handling multiple promises with Promise.all(). Learn how to write clean, efficient async code with Promises.

  • 01 Introduction to Asynchronous
  • 02 Introduction to Promises
  • 03 Constructing an Promise Object
  • 04 Node Set Timeout Function
  • 05 Consuming Promises
  • 06 Catch with Promise
  • 07 Catching the Multiple Promises
  • 08 Using Promise.all() function
  • 09 Promises cheatsheet

15 Async Await

Async/Await is a modern JavaScript syntax that makes working with asynchronous code more intuitive and readable. It builds on Promises to provide a cleaner way to handle asynchronous operations. This chapter covers the fundamentals of async/await, including the async keyword for declaring asynchronous functions, the await operator for pausing execution until Promises resolve, proper error handling with try/catch blocks, and managing multiple Promises concurrently with Promise.all(). By the end of this chapter, you'll be able to write asynchronous code that looks and behaves more like synchronous code.

  • 01 Introduction to Async-Await
  • 02 Async Keyword
  • 03 Await operator
  • 04 Writing Async function
  • 05 Await Promise.all()

16 API Request in JavaScript

This chapter covers making HTTP requests in modern JavaScript using the Fetch API. You'll learn how to interact with web services and APIs through GET and POST requests, both using Promise-based syntax and the more modern async/await approach. The chapter demonstrates practical examples of retrieving data from servers and sending data to them.

  • 01 Introduction to Requests with ES6 JavaScript
  • 02 GET Request using fetch
  • 03 POST Request using fetch
  • 04 GET Async await using fetch
  • 05 POST request, Async and Await with Fetch API

17 Debugging in JavaScript

Debugging in JavaScript can be a daunting task, but with the right tools and techniques, you can quickly identify and fix errors in your code. In this chapter, we'll take a closer look at how to read error stack traces and understand the different types of JavaScript errors, giving you the skills you need to tackle even the toughest debugging challenges.

  • 01 Error Stack Trace
  • 02 JavaScript error types

18 Error Handling in JavaScript

Learn how to handle errors in JavaScript, including runtime error handling, constructing custom errors, using the throw keyword, and working with try-catch statements to write more robust and reliable code.

  • 01 Runtime Error Handling
  • 02 Constructing an Error
  • 03 Throw keyword in JavaScript
  • 04 Try Catch Error Statement

19 Hoisting in JavaScript

Hoisting affects how variables are scoped and executed in JavaScript. This chapter explores its mechanics and differences between var, let, and const declarations, helping you write more predictable and maintainable code.

  • 01 Introduction to Hoisting
  • 02 Var Hoisting
  • 03 Let and Const Hoisting

20 JavaScript ES6+ Features

Discover the power of JavaScript ES6+ features and take your development skills to the next level. This book covers 20 essential features, from template literals to async/await, providing a comprehensive guide to writing modern, efficient, and maintainable code.

  • 01 Template Literals
  • 02 Destructuring
  • 03 Spread and Rest Operators
  • 04 Default Parameters
  • 05 Arrow Functions
  • 06 Classes and Inheritance
  • 07 Promises and Async/Await
  • 08 String and Number Methods
  • 09 Array and Object Methods
  • 10 Closures
  • 11 Currying

Simple practice projects

  • 01 Kelvin To Fahrenheit Converter
  • 02 Coin Flip Simulator
  • 03 Student Grade Checker
  • 04 Rock Paper Scissors
  • 05 Star Patterns Using Loops
  • 06 Media Library using Classes
  • 07 Simple GET request using Fetch API
  • 08 Simple POST request using Fetch API

JavaScript Cheet Sheet

  • 01 JavaScript Cheat sheet
  • 02 Data Types in Javascript
  • 03 Promises cheatsheet

About

Welcome to the JavaScript-For-Beginners repository! This repository is designed to help beginners learn the basics of JavaScript through examples and exercises.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published