JavaScript is a scripting language that allows dynamic interactivity on web pages. It was invented by Brendan Eich and was originally known as LiveScript. JavaScript is used to validate user input, provide immediate feedback, and create rich interfaces. While it runs on the client-side, JavaScript has limitations like not being able to read/write files or do networking. The language uses syntax like semicolons, comments, variables, operators, control flow, functions, events, objects, arrays, and error handling to add interactivity to web pages. JSON is a text format used to store and exchange data that is written with JavaScript object notation.
2. JavaScript | Introduction
JavaScript (JS) is a full-fledged dynamic programming language that, when
applied to an HTML document, can provide dynamic interactivity on websites.
It was invented by Brendan Eich, co-founder of the Mozilla project, the Mozilla
Foundation, and the Mozilla Corporation.
JavaScript was first known as LiveScript.
3. JavaScript | Introduction
JavaScript is a scripting or programming language that allows you to
implement complex things on web pages
ECMAScript is the official name of the language.
JavaScript and Java are completely different languages,
both in concept and design.
4. Advantages of JavaScript
● Less server interaction − You can validate user input before sending the
page off to the server. This saves server traffic, which means less load on
your server.
● Immediate feedback to the visitors − They don't have to wait for a page
reload to see if they have forgotten to enter something.
● Increased interactivity − You can create interfaces that react when the
user hovers over them with a mouse or activates them via the keyboard.
● Richer interfaces − You can use JavaScript to include such items as drag-
and-drop components and sliders to give a Rich Interface to your site
visitors.
5. Limitations of JavaScript
● Client-side JavaScript does not allow the reading or writing of files. This
has been kept for security reason.
● JavaScript cannot be used for networking applications because there is
no such support available.
● JavaScript doesn't have any multithreading or multiprocessor
capabilities.
6. Syntax | JavaScript
● JavaScript ignores whitespace and line breaks
● Semicolons are optional
● JavaScript is a case-sensitive language
● JavaScript supports both C-style and C++ style comments
8. Variables | JavaScript
● Primitive data types
○ Number
○ String
○ Boolean
*All numbers in JavaScript are represented as floating-point values.
JavaScript represents numbers using the 64-bit floating-point format defined by the IEEE 754 standard.
9. Variables | JavaScript
● Declare
● Assign the value
● Scope
○ Global
○ Local
● JavaScript reserved words
11. Control Flow | JavaScript
● If .. else
● Switch Case
● While loop
● For loop
● Loop Control
12. Functions | JavaScript
A function is a group of reusable code which can be called anywhere in your
program.
● Definition
● Parameters
● Return statement
14. Objects | JavaScript
● Encapsulation − the capability to store related information, whether data or
methods, together in an object.
● Aggregation − the capability to store one object inside another object.
● Inheritance − the capability of a class to rely upon another class (or
number of classes) for some of its properties and methods.
● Polymorphism − the capability to write one function or method that works
in a variety of different ways.
17. Form Validation | JavaScript
● Basic Validation
● Data Format Validation
18. Introduction | JSON
● JSON: JavaScript Object Notation
● JSON is a syntax for storing and exchanging data
● JSON is text, written with JavaScript object notation
● { name : "John" }
● { "name" : "John" }