JavaScript tutorial

In this JavaScript tutorial we propose many exercises with relative explanation and demonstration, in order to easily learn the basics of one of the most used programming languages ​​in the web.

JavaScript language is an object-oriented and event-oriented scripting language. It is used in client-side web programming to create page controls or dynamic effects.

JavaScript is a language that has spread a lot thanks to the presence of numerous frameworks and libraries.

Before starting to program you can also dedicate yourself to reading the following article: how to learn to program.

JavaScript tutorial – index of topics

Introduction to JavaScript

  1. Introduction to JavaScript language
  2. Learn JavaScript – basic concepts
  3. JavaScript variables and costants
  4. Conditional instruction if, else
  5. Console log in JavaScript

String Method

In this part of the JavaScript tutorial we will study some useful methods and properties with strings, namely the methods toUpperCase, toLowerCase, etc… We will come back to talking about strings later.

  1. toUpperCase
  2. toLowerCase
  3. substring in JavaScript
  4. trim
  5. split
  6. includes string
  7. indexOf
  8. lastIndexOf
  9. replace
  10. search
  11. charAt
  12. charCodeAt
  13. length
  14. slice in JavaScript
  15. match

JavaScript turorial – iterative constructs

  1. While loop
  2. Do while loop
  3. For loop

JavaScript function

We introduce some JavaScript functions, particularly useful for showing and taking input data.

  1. Introduction function
  2. JavaScript alert
  3. JavaScript confirm
  4. Use JavaScript prompt

Exercises with strings

  1. Exercises on strings
  2. Palindrome word in JavaScript
  3. How to determine the longest word in JavaScript
  4. Regular expressions

JavaScript Tutorial – Examples and exercises with iterative structures

  1. Exercises for loop:
    • Count odd and even numbers and count positive, negative and null numbers
    • Calculate the average and count multiples of a number
    • Add even and odd separately and add positives and negatives separately
    • Print the first N odd numbers following a number A and ask for 10 numbers as input and add only the positive ones.
    • Pairs of natural numbers whose sum is 30 and establish whether a product is negative, positive or null without carrying out the operation.
  2. Nested for loops
  3. How to develop a multiplication table
  4. Fibonacci in JavaScript
  5. Prime numbers in JavaScript

JavaScript functions

In this section of the JavaScript tutorial we will study some predefined functions.

  1. ParseInt
  2. ParseFloat
  3. isNaN
  4. String
  5. Eval

JavaScript Tutorial – Math JavaScript

  1. Math.random
  2. Math.floor

JavaScript Tutorial – Arrays

In this section of the JavaScript tutorial we will study some methods and properties that are useful with arrays in JavaScript, such as the pusch method, pop, the length property, etc.

  1. Array in JavaScript
  2. JavaScript Array length
  3. push() in JavaScript
  4. pop() in JavaScript
  5. shift() and unshift()
  6. includes()
  7. indexOf()
  8. map()
  9. sort()
  10. reverse()
  11. splice()
  12. slice()
  13. toString()
  14. join()
  15. forEach()
  16. isArray()
  17. filter()
  18. Constructor in JavaScript

Loops with arrays – exercises

  1. Examples for loops with arrays
  2. Exercises with the for loop and arrays

Game in JavaScript

In this section of the JavaScript tutorial we will develop fun and creative games in order to better learn some programming concepts.

  1. Guess Number in JavaScript
  2. Chinese morra game in JavaScript
  3. Games in JavaScript – Simple quiz using arrays
  4. How to make online dice games
  5. 15 puzzle game in JavaScript
  6. Slot machine in JavaScript
  7. Memory Game in JavaScript
  8. Compare numbers

Projects

  1. Projects
  2. JavaScript to do list
  3. Random quotes generator

Functions

In this part of the JavaScript language tutorial we will delve into functions and talk about callback functions.

  1. JavaScript functions and return
  2. JavaScript Callback
  3. Callbacks
  4. Array method and callback functions
  5. Callback functions – examples
  6. Callback and setTimeout

Tutorial JavaScript – Il DOM

In this part of the JavaScript language tutorial we will study some methods and properties that are useful for manipulating the DOM in JavaScript, such as creating and removing attributes.

  1. Dom in JavaScript
  2. JavaScript createElement()
  3. CreateTextNode()
  4. Add attributes in JavaScript (createAttribute and setAttributeNode)
  5. Remove attributes
  6. JavaScript getElementById
  7. Insights into the method getElementById

Esercizi sul DOM in JavaScript

  1. How to validate a form in JavaScript
  2. JavaScript Calculator
  3. Caesar cipher decoder
  4. Decimal to binary, octal and hexadecimal converter
  5. Binary decimal conversion
  6. How to develop an image gallery in JavaScript
  7. addEventListener

Oggetti JavaScript, proprietà e metodi

  1. Introduction to objects in JavaScript
  2. How to create an object in JavaScript
  3. Object in JavaScript
  4. Use object Create
  5. Object defineproperties
  6. Object assign
  7. Class JavaScript
  8. Exercises on objects in JavaScript
  9. Array of objects
  10. Introduction to the for in loop with objects in JavaScript
  11. Objects and for in loop
  12. Exercises on objects and arrays
  13. How to sort an array of objects

JSON

In this section of the JavaScript language tutorial, we look at some useful ways to use JSON-formatted data in JavaScript.

  1. Format JSON
  2. JSON parse
  3. Parsing JSON
  4. JSON stringify

AJAX

  1. Introduction to AJAX
  2. XMLHttpRequest object
  3. AJAX and JSON

Tutorial JavaScript – Creare PDF

  1. How to create PDF with JavaScript
  2. PDF from a form with JavaScript
  3. Properties of a PDF with JavaScript
  4. JsPDF library

Canvas in JavaScript

  1. How to use canvas in JavaScript
  2. Canvas exercises with JavaScript