JavaScript Tuorial
JavaScript
JavaScript is the world's most popular programming language.
JavaScript is the programming language of the Web.
JavaScript is easy to learn.
This tutorial will teach you JavaScript from basic to advanced.
Why Study JavaScript?
JavaScript is one of the 3 languages all web developers must learn:
1. HTML to define the content of web pages
2. CSS to specify the layout of web pages
3. JavaScript to program the behavior of web pages
Console Logs:-
In JavaScript, a console is an object which provides access to the browser debugging console. This object provides us with several different methods like log(), error() ,table() etc. Each method provides different functionalities. For more in-depth information, click on the link:
Variables In JavaScript:-
Data types in JavaScript are either Variables or Constants. ES6 has major changes over JavaScript's syntax and brings new features. Initially, we declare variables with a keyword "var". However, ES6 brings a new variable declaration keyword, "let" and "const." To create a single line comment in JavaScript, we have to place two slashes "//" in front of the code or text that we want the interpreter to ignore. Although a single line comment is quite useful, when we want to comment on a long segment of code, we have to use a multiline comment. The multiline comment begins with /* and ends with */
Data Types In JavaScript:-
In JavaScript, a variable stores two types of values: primitive and reference. JavaScript provides six primitive types like Boolean, number, string, undefined, null, symbol, and a reference type as object literals, array, functions, and dates. When we assign a value to a variable, the JavaScript engine will determine whether the value belongs to primitive or reference datatype.
Condition Statements:-
The if statement is one of the most popular statements that are used by the programmers. We use if statement when we want to execute a statement if a certain condition is satisfied. When the if condition evaluates to false, we use the else statement. The else statement must follow the if or else if statement. Multiple else statement at the same time is not allowed.
Functions In JavaScript:-
A function is a group of reusable code which can be called anywhere in the program. A Function Declaration defines a named function. To create a function declaration, use the function keyword, and then write the function's name.
Arrays In JavaScript:-
Arrays are the objects in which we can store multiple values in a single variable. An array stores a sequential collection of elements of fixes size. Arrays are zero-indexed. The first element of an array is store at 0 indexes, and the second element store at index 1, and so on
Loops In JavaScript:-
Duplicating code is never a good idea. The versatility of the computer lies in its ability to perform the set of instructions repeatedly. The generic solution for repeating code with control is provided in the form of loops. There are four kinds of loops in JavaScript that we can use to repeat some code. These are for, for…in, forEach, while, do…while.
Strings In JavaScript:-
As we know, strings are useful for holding data that can be represented in text form. One of the most popular operations on strings are to check their length, to build and concatenate them using the operator (+), checking for the existence or location of substrings with the indexOf() method, or extracting substrings with the substring() method.
Dom manipulation:-
A DOM represents the HTML document that is displayed in that window. The Document object has various properties that allow access to and modification of document content. We can access the document content and modified it is called the Document Object Model, or DOM.
HTML Elements Selector:-
DOM Selectors is used to selecting HTML elements within a document using JavaScript. There are two types of selector, i.e., single element selector and multiple element selector.To traverse downwards from a specific element, we can use querySelector( ) or querySelectorAll( )
Arrow functions:-
One of the most famous features in modern JavaScript is the arrow function.ES6 arrow functions provide us an alternative way to write a more concise and shorter syntax compared to the traditional function expression.
Date Object:-
With the advent of time, mathematical calculations have become an integral part of every programming language. In this article, we will cover the details of the Math object in JavaScript, which helps the user to perform all kinds of mathematical operations.
Local and session storage:-
The way to store data on the client's computer is by local storage. The local storage allows us to save the key/value pairs in a web browser, and it stores data with no expiration date. The session storage is used to store data only for a session, meaning that it is stored until the browser (or tab) is closed.
Template literal:-
Prior to ES6, we use single quotes (') or double quotes (") to wrap a string literal. At that time, the strings have very limited functionality. To help us in solving more complex problems, ES6 template literals provide the syntax that allows you to work with strings in a very cleaner way. In ES6, we can create a template literal by wrapping the string in backticks (``).
Code file index.html as described in the video
Code file index.js as described in the video
Comments
Post a Comment