SlideShare une entreprise Scribd logo
1  sur  6
JavaScript basics
Dept. of CSE, YCET Jammu 1
1.1 INTRODUCTION
CHAPTER 1
INTRODUCTION [1]
JavaScript is a lightweight, cross-platform, and interpreted scripting language. It is well-known for the
development of webpages , many non-browser environments also use it. JavaScript can be used for Client-
side developments as well as Server-side developments. JavaScript contains a standard library of objects, like
Array, Date, and Math, and a core set of language elements like operators, control structures, and statements.
1. Client-side: It supplies objects to control a browser and its Document Object Model (DOM). Like if
client-side extensions allow an application to place elements on an HTML form and respond to user
events such as mouse clicks, form input, and page navigation. Useful libraries for the client-side are
AngularJS, ReactJS, VueJS and so many others.
2. Server-side: It supplies objects relevant to running JavaScript on a server. Like if the server-side
extensions allow an application to communicate with a database, and provide continuity of information
from one invocation to another of the application, or perform file manipulations on a server. The useful
framework which is the most famous these days is node.js.
It was created in 1995 by Brendan Eich while he was an engineer at Netscape. It was originally going to be
named LiveScript but was renamed. Unlike most programming languages, the JavaScript language has no
concept of input or output. It is designed to run as a scripting language in a host environment, and it is up to
the host environment to provide mechanisms for communicating with the outside world. The most common
host environment is the browser.
Features of JavaScript: According to a recent survey conducted by Stack Overflow, JavaScript is the most
popular language on earth.
With advances in browser technology and JavaScript having moved into the server with Node.js and other
frameworks, JavaScript is capable of so much more.
Applications of JavaScript:
1. Web Development: Adding interactivity and behavior to static sites JavaScript was invented to do this in
1995. By using AngularJS that can be achieved so easily.
2. Web Applications: With technology, browsers have improved to the extent that a language was required
to create robust web applications. When we explore a map in Google Maps then we only need to click
and drag the mouse. All detailed view is just a click away, and this is possible only because of JavaScript.
It uses Application Programming Interfaces(APIs) that provide extra power to the code. The Electron and
React is helpful in this department.
3. Server Applications: With the help of Node.js, JavaScript made its way from client to server and node.js
is the most powerful on the server-side.
JavaScript basics
Dept. of CSE, YCET Jammu 2
4. Games: Not only in websites, but JavaScript also helps in creating games for leisure. The combination of
JavaScript and HTML 5 makes JavaScript popular in game development as well. It provides the EaseJS
library which provides solutions for working with rich graphics.
5. Smartwatches: JavaScript is being used in all possible devices and applications. It provides a library
PebbleJS which is used in smartwatch applications. This framework works for applications that require
the internet for its functioning.
6. Art: Artists and designers can create whatever they want using JavaScript to draw on HTML 5 canvas,
make the sound more effective also can be used p5.js library.
7. Machine Learning: This JavaScript ml5.js library can be used in web development by using machine
learning.
Limitations of JavaScript:
1. Performance: JavaScript does not provide the same level of performance as offered by many traditional
languages as a complex program written in JavaScript would be comparatively slow. But as JavaScript
is used to perform simple tasks in a browser, so performance is not considered a big restriction in its
use.
2. Complexity: To master a scripting language, programmers must have a thorough knowledge of all the
programming concepts, core language objects, client and server-side objects otherwise it would be
difficult for them to write advanced scripts using JavaScript.
3. Weak error handling and type checking facilities: It is weakly typed language as there is no need to
specify the data type of the variable. So wrong type checking is not performed by compile.
1.2 HOW DOES JAVASCRIPT WORK
JavaScript is what is known as a client-side script. Most Web applications, such as a search engine, work
because of an interaction between the user's device (e.g. computer, phone or tablet) and a remote server. The
software on the remote server sends information to the client (i.e. the user's machine) and the software on the
client side reads the information and renders a Web page on screen.
A client-side script is a programming language that performs its tasks entirely on the client's machine and does
not need to interact with the server to function. For instance, if you have a Web page loaded on your computer
and your Internet service provider goes down, you are still able to interact with the Web pages already loaded
on your browser. You will not, however, be able to navigate to new Web pages or access any data located
remotely.
Some of the dynamic website enhancements performed by JavaScript are:
Autocomplete
Loading new content or data onto the page without reloading the page
Rollover effects and dropdown menus
Animating page elements such as fading, resizing or relocating
Playing audio and video
JavaScript basics
Dept. of CSE, YCET Jammu 3
Validating input from Web forms
While JavaScript is a client-side language, some of its most powerful features involve asynchronous
interaction with a remote server. Asynchronous simply means that JavaScript is able to communicate with the
server in the background without interrupting the user interaction taking place in the foreground.
Take a search engine for example. Today, search engines almost all have an autocomplete function. The user
begins typing a word into the search box and a list of possible search terms or phrases appears below. The
experience is seamless. Suggested search terms appear without reloading the page.
In the background, JavaScript reads the letters as the user types, sends those letters to a remote server and the
server sends suggestions back.
The software on the server side analyses the words and runs algorithms to anticipate the user's search term.
Such programs are diabolically large and complex. The JavaScript on the client's machine is as simple and
small as possible so as not to slow down the user's interaction. The communication between JavaScript and
the server-side program is limited by the user's bandwidth. This is why developers prioritize efficiency in
JavaScript functions and make the amount of data communicated between the programs as small as possible.
Only once the user selects a search term does the entire page reload and produce the search results. Engines
such as Google have reduced or eliminated the need to reload, even for that step. They simply produce results
using the same asynchronous process.
Fig. 1.1 JavaScript
JavaScript basics
Dept. of CSE, YCET Jammu 4
CHAPTER 2
HISTORY OF JAVASCRIPT [2]
2.1 HISTORY AND EVOLUTION
Before the introduction of JavaScript, web pages were static. To achieve any level interaction,
multiple requests had to be made to the server, upon which, whole new documents would be
generated, even for the smallest change. JavaScript was conceived as an embedded scripting
language for the web browser by Brendan Eich at Netscape. It provided the means of
manipulating HTML documents, circumventing the need for multiple page requests, thus
providing richer experiences without delay or page refreshes. This facilitated functionality like
client-side form validation, animation and reaction to user input (e.g. clicks and key presses). It
first shipped with the Netscape browser in 1995[34], and from that point onward, every new
browser came equipped with some version of JavaScript. Now a fully-fledged programming
language, it is ubiquitous; since it is the [? ] language of the web, any device with a respectable
form of web access will have a JavaScript implementation. This includes all major operating
systems, and devices ranging from desktops to mobiles. Most browser vendors implement their
own JavaScript engine—a piece of software that will interpret and execute JavaScript code,
according to the ECMAScript1
specifications Examples of JavaScript engines include V8
(Google Chrome), Spidermonkey (Firefox) and JavaScriptCore (Safari).
Douglas Crockford, a senior JavaScript architect at Yahoo and a thought-leader in JavaScript
development, describes the language as “Lisp in C’s clothing”[15]. Lisp is a popular
programming language for a number of reasons, including its powerful meta-programming
abilities and higher-order functions. In designing the language, Eich wanted to expose some Lisp-
like power to JavaScript, but he was restricted in terms of what the syntax could look like. This
was due to a Netscape marketing ploy to capitalise on the popularity of Java at the time
JavaScript was conceived. It had to “look like Java only less so”[19].
While the browser remains the most widespread implementation of JavaScript, its popularity
has lead to appearances elsewhere. Node.js[28], a relatively new development, is one such
example—a platform designed for writing networked applications (e.g. web servers). Node
makes use of Google’s V8 JavaScript engine, adding support for file and network IO, meaning
that JavaScript can be used to write a more traditional style of program outside of the browser.
It has experienced a great deal of exposure based on its speed and ideology, and as a result has
become a popular platform. Other uses of JavaScript outside of the browser include plugins for
Adobe Photoshop and Dashboard Widgets for Mac OS X.
JavaScript basics
Dept. of CSE, YCET Jammu 5

]
2.2 JAVASCRIPT’s FUTURE
JavaScript has come a long way since its original implementation: it took a mere 10 days to write it. The
JavaScript standard, proposed for the first time as ECMAScript 1 in 1997, is, as of late 2018, in its 9th iteration
(ES 2018). The differences between the specifications described in ECMAScript 1 and ES 2018 are immense:
they seem to describe different languages. In the intervening years, JavaScript has undergone massive changes.
Not everyone agreed with every change, but, taken together, they made JavaScript a more robust, secure, and
expressive language.
The JavaScript community of today is arguably the most active community in programming. It sometimes seems
that every week sees releases of new tools, frameworks, and libraries. There are preprocessors and transpilers
of all sorts available, ranging from programs that translate modern JavaScript programs so older JavaScript
engines can run them, to compiling entirely new languages with JavaScript. The JavaScript standard itself is a
continuously evolving document, with improvements introduced at a rapid rate. JavaScript engines incorporate
the changes almost as rapidly. New operating systems under development (e.g., Google's Fuchsia) are adding
support for the development of native applications in JavaScript. All of this means that JavaScript has an exciting
future. It's a great time to learn JavaScript.
JavaScript basics
Dept. of CSE, YCET Jammu 6

Contenu connexe

Similaire à INTRODUCTION.docx

Top 11 Front-End Web Development Tools To Consider in 2020
 Top 11 Front-End Web Development Tools To Consider in 2020 Top 11 Front-End Web Development Tools To Consider in 2020
Top 11 Front-End Web Development Tools To Consider in 2020Katy Slemon
 
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptxLATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptxchitrachauhan21
 
Top 10 Best Web Development Technologies
Top 10 Best Web Development TechnologiesTop 10 Best Web Development Technologies
Top 10 Best Web Development TechnologiesAjayMishra302670
 
The Positive and Negative Aspects of Node.js Web App Development.pdf
The Positive and Negative Aspects of Node.js Web App Development.pdfThe Positive and Negative Aspects of Node.js Web App Development.pdf
The Positive and Negative Aspects of Node.js Web App Development.pdfWDP Technologies
 
Web programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh MalothWeb programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh MalothBhavsingh Maloth
 
WEB PROGRAMMING UNIT II BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT II BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT II BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT II BY BHAVSINGH MALOTHBhavsingh Maloth
 
Top 12 Front End Technologies to Use In 2023.pdf
Top 12 Front End Technologies to Use In 2023.pdfTop 12 Front End Technologies to Use In 2023.pdf
Top 12 Front End Technologies to Use In 2023.pdfLaura Miller
 
Top 12 Front End Technologies to Use In 2024.pdf
Top 12 Front End Technologies to Use In 2024.pdfTop 12 Front End Technologies to Use In 2024.pdf
Top 12 Front End Technologies to Use In 2024.pdfLaura Miller
 
COMP6210 Web Services And Design Methodologies.docx
COMP6210 Web Services And Design Methodologies.docxCOMP6210 Web Services And Design Methodologies.docx
COMP6210 Web Services And Design Methodologies.docxwrite31
 
JavaScript Overview_ Features, History, Advantages, and Limitations.docx
JavaScript Overview_ Features, History, Advantages, and Limitations.docxJavaScript Overview_ Features, History, Advantages, and Limitations.docx
JavaScript Overview_ Features, History, Advantages, and Limitations.docxStudySection
 
Latest Web development technologies 2021
 Latest Web development technologies 2021 Latest Web development technologies 2021
Latest Web development technologies 2021SWATHYSMOHAN
 
Asp Net Vs Vue JS Which One You Should Choose for Development.pdf
Asp Net Vs Vue JS Which One You Should Choose for Development.pdfAsp Net Vs Vue JS Which One You Should Choose for Development.pdf
Asp Net Vs Vue JS Which One You Should Choose for Development.pdfIntegrated IT Solutions
 

Similaire à INTRODUCTION.docx (20)

Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Top 11 Front-End Web Development Tools To Consider in 2020
 Top 11 Front-End Web Development Tools To Consider in 2020 Top 11 Front-End Web Development Tools To Consider in 2020
Top 11 Front-End Web Development Tools To Consider in 2020
 
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptxLATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
 
Top 10 Best Web Development Technologies
Top 10 Best Web Development TechnologiesTop 10 Best Web Development Technologies
Top 10 Best Web Development Technologies
 
The Positive and Negative Aspects of Node.js Web App Development.pdf
The Positive and Negative Aspects of Node.js Web App Development.pdfThe Positive and Negative Aspects of Node.js Web App Development.pdf
The Positive and Negative Aspects of Node.js Web App Development.pdf
 
Javascript frameworks
Javascript frameworksJavascript frameworks
Javascript frameworks
 
Web programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh MalothWeb programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh Maloth
 
WEB PROGRAMMING UNIT II BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT II BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT II BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT II BY BHAVSINGH MALOTH
 
Top 12 Front End Technologies to Use In 2023.pdf
Top 12 Front End Technologies to Use In 2023.pdfTop 12 Front End Technologies to Use In 2023.pdf
Top 12 Front End Technologies to Use In 2023.pdf
 
Analysis
AnalysisAnalysis
Analysis
 
Top 12 Front End Technologies to Use In 2024.pdf
Top 12 Front End Technologies to Use In 2024.pdfTop 12 Front End Technologies to Use In 2024.pdf
Top 12 Front End Technologies to Use In 2024.pdf
 
Top 10 Javascript Frameworks For Easy Web Development
Top 10 Javascript Frameworks For Easy Web DevelopmentTop 10 Javascript Frameworks For Easy Web Development
Top 10 Javascript Frameworks For Easy Web Development
 
COMP6210 Web Services And Design Methodologies.docx
COMP6210 Web Services And Design Methodologies.docxCOMP6210 Web Services And Design Methodologies.docx
COMP6210 Web Services And Design Methodologies.docx
 
Food borne human diseases
Food borne human diseasesFood borne human diseases
Food borne human diseases
 
JavaScript Overview_ Features, History, Advantages, and Limitations.docx
JavaScript Overview_ Features, History, Advantages, and Limitations.docxJavaScript Overview_ Features, History, Advantages, and Limitations.docx
JavaScript Overview_ Features, History, Advantages, and Limitations.docx
 
Ajax presentation
Ajax presentationAjax presentation
Ajax presentation
 
Latest Web development technologies 2021
 Latest Web development technologies 2021 Latest Web development technologies 2021
Latest Web development technologies 2021
 
AFTAB AHMED.pptx
AFTAB AHMED.pptxAFTAB AHMED.pptx
AFTAB AHMED.pptx
 
06 Javascript
06 Javascript06 Javascript
06 Javascript
 
Asp Net Vs Vue JS Which One You Should Choose for Development.pdf
Asp Net Vs Vue JS Which One You Should Choose for Development.pdfAsp Net Vs Vue JS Which One You Should Choose for Development.pdf
Asp Net Vs Vue JS Which One You Should Choose for Development.pdf
 

Dernier

H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 

Dernier (20)

H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 

INTRODUCTION.docx

  • 1. JavaScript basics Dept. of CSE, YCET Jammu 1 1.1 INTRODUCTION CHAPTER 1 INTRODUCTION [1] JavaScript is a lightweight, cross-platform, and interpreted scripting language. It is well-known for the development of webpages , many non-browser environments also use it. JavaScript can be used for Client- side developments as well as Server-side developments. JavaScript contains a standard library of objects, like Array, Date, and Math, and a core set of language elements like operators, control structures, and statements. 1. Client-side: It supplies objects to control a browser and its Document Object Model (DOM). Like if client-side extensions allow an application to place elements on an HTML form and respond to user events such as mouse clicks, form input, and page navigation. Useful libraries for the client-side are AngularJS, ReactJS, VueJS and so many others. 2. Server-side: It supplies objects relevant to running JavaScript on a server. Like if the server-side extensions allow an application to communicate with a database, and provide continuity of information from one invocation to another of the application, or perform file manipulations on a server. The useful framework which is the most famous these days is node.js. It was created in 1995 by Brendan Eich while he was an engineer at Netscape. It was originally going to be named LiveScript but was renamed. Unlike most programming languages, the JavaScript language has no concept of input or output. It is designed to run as a scripting language in a host environment, and it is up to the host environment to provide mechanisms for communicating with the outside world. The most common host environment is the browser. Features of JavaScript: According to a recent survey conducted by Stack Overflow, JavaScript is the most popular language on earth. With advances in browser technology and JavaScript having moved into the server with Node.js and other frameworks, JavaScript is capable of so much more. Applications of JavaScript: 1. Web Development: Adding interactivity and behavior to static sites JavaScript was invented to do this in 1995. By using AngularJS that can be achieved so easily. 2. Web Applications: With technology, browsers have improved to the extent that a language was required to create robust web applications. When we explore a map in Google Maps then we only need to click and drag the mouse. All detailed view is just a click away, and this is possible only because of JavaScript. It uses Application Programming Interfaces(APIs) that provide extra power to the code. The Electron and React is helpful in this department. 3. Server Applications: With the help of Node.js, JavaScript made its way from client to server and node.js is the most powerful on the server-side.
  • 2. JavaScript basics Dept. of CSE, YCET Jammu 2 4. Games: Not only in websites, but JavaScript also helps in creating games for leisure. The combination of JavaScript and HTML 5 makes JavaScript popular in game development as well. It provides the EaseJS library which provides solutions for working with rich graphics. 5. Smartwatches: JavaScript is being used in all possible devices and applications. It provides a library PebbleJS which is used in smartwatch applications. This framework works for applications that require the internet for its functioning. 6. Art: Artists and designers can create whatever they want using JavaScript to draw on HTML 5 canvas, make the sound more effective also can be used p5.js library. 7. Machine Learning: This JavaScript ml5.js library can be used in web development by using machine learning. Limitations of JavaScript: 1. Performance: JavaScript does not provide the same level of performance as offered by many traditional languages as a complex program written in JavaScript would be comparatively slow. But as JavaScript is used to perform simple tasks in a browser, so performance is not considered a big restriction in its use. 2. Complexity: To master a scripting language, programmers must have a thorough knowledge of all the programming concepts, core language objects, client and server-side objects otherwise it would be difficult for them to write advanced scripts using JavaScript. 3. Weak error handling and type checking facilities: It is weakly typed language as there is no need to specify the data type of the variable. So wrong type checking is not performed by compile. 1.2 HOW DOES JAVASCRIPT WORK JavaScript is what is known as a client-side script. Most Web applications, such as a search engine, work because of an interaction between the user's device (e.g. computer, phone or tablet) and a remote server. The software on the remote server sends information to the client (i.e. the user's machine) and the software on the client side reads the information and renders a Web page on screen. A client-side script is a programming language that performs its tasks entirely on the client's machine and does not need to interact with the server to function. For instance, if you have a Web page loaded on your computer and your Internet service provider goes down, you are still able to interact with the Web pages already loaded on your browser. You will not, however, be able to navigate to new Web pages or access any data located remotely. Some of the dynamic website enhancements performed by JavaScript are: Autocomplete Loading new content or data onto the page without reloading the page Rollover effects and dropdown menus Animating page elements such as fading, resizing or relocating Playing audio and video
  • 3. JavaScript basics Dept. of CSE, YCET Jammu 3 Validating input from Web forms While JavaScript is a client-side language, some of its most powerful features involve asynchronous interaction with a remote server. Asynchronous simply means that JavaScript is able to communicate with the server in the background without interrupting the user interaction taking place in the foreground. Take a search engine for example. Today, search engines almost all have an autocomplete function. The user begins typing a word into the search box and a list of possible search terms or phrases appears below. The experience is seamless. Suggested search terms appear without reloading the page. In the background, JavaScript reads the letters as the user types, sends those letters to a remote server and the server sends suggestions back. The software on the server side analyses the words and runs algorithms to anticipate the user's search term. Such programs are diabolically large and complex. The JavaScript on the client's machine is as simple and small as possible so as not to slow down the user's interaction. The communication between JavaScript and the server-side program is limited by the user's bandwidth. This is why developers prioritize efficiency in JavaScript functions and make the amount of data communicated between the programs as small as possible. Only once the user selects a search term does the entire page reload and produce the search results. Engines such as Google have reduced or eliminated the need to reload, even for that step. They simply produce results using the same asynchronous process. Fig. 1.1 JavaScript
  • 4. JavaScript basics Dept. of CSE, YCET Jammu 4 CHAPTER 2 HISTORY OF JAVASCRIPT [2] 2.1 HISTORY AND EVOLUTION Before the introduction of JavaScript, web pages were static. To achieve any level interaction, multiple requests had to be made to the server, upon which, whole new documents would be generated, even for the smallest change. JavaScript was conceived as an embedded scripting language for the web browser by Brendan Eich at Netscape. It provided the means of manipulating HTML documents, circumventing the need for multiple page requests, thus providing richer experiences without delay or page refreshes. This facilitated functionality like client-side form validation, animation and reaction to user input (e.g. clicks and key presses). It first shipped with the Netscape browser in 1995[34], and from that point onward, every new browser came equipped with some version of JavaScript. Now a fully-fledged programming language, it is ubiquitous; since it is the [? ] language of the web, any device with a respectable form of web access will have a JavaScript implementation. This includes all major operating systems, and devices ranging from desktops to mobiles. Most browser vendors implement their own JavaScript engine—a piece of software that will interpret and execute JavaScript code, according to the ECMAScript1 specifications Examples of JavaScript engines include V8 (Google Chrome), Spidermonkey (Firefox) and JavaScriptCore (Safari). Douglas Crockford, a senior JavaScript architect at Yahoo and a thought-leader in JavaScript development, describes the language as “Lisp in C’s clothing”[15]. Lisp is a popular programming language for a number of reasons, including its powerful meta-programming abilities and higher-order functions. In designing the language, Eich wanted to expose some Lisp- like power to JavaScript, but he was restricted in terms of what the syntax could look like. This was due to a Netscape marketing ploy to capitalise on the popularity of Java at the time JavaScript was conceived. It had to “look like Java only less so”[19]. While the browser remains the most widespread implementation of JavaScript, its popularity has lead to appearances elsewhere. Node.js[28], a relatively new development, is one such example—a platform designed for writing networked applications (e.g. web servers). Node makes use of Google’s V8 JavaScript engine, adding support for file and network IO, meaning that JavaScript can be used to write a more traditional style of program outside of the browser. It has experienced a great deal of exposure based on its speed and ideology, and as a result has become a popular platform. Other uses of JavaScript outside of the browser include plugins for Adobe Photoshop and Dashboard Widgets for Mac OS X.
  • 5. JavaScript basics Dept. of CSE, YCET Jammu 5 ] 2.2 JAVASCRIPT’s FUTURE JavaScript has come a long way since its original implementation: it took a mere 10 days to write it. The JavaScript standard, proposed for the first time as ECMAScript 1 in 1997, is, as of late 2018, in its 9th iteration (ES 2018). The differences between the specifications described in ECMAScript 1 and ES 2018 are immense: they seem to describe different languages. In the intervening years, JavaScript has undergone massive changes. Not everyone agreed with every change, but, taken together, they made JavaScript a more robust, secure, and expressive language. The JavaScript community of today is arguably the most active community in programming. It sometimes seems that every week sees releases of new tools, frameworks, and libraries. There are preprocessors and transpilers of all sorts available, ranging from programs that translate modern JavaScript programs so older JavaScript engines can run them, to compiling entirely new languages with JavaScript. The JavaScript standard itself is a continuously evolving document, with improvements introduced at a rapid rate. JavaScript engines incorporate the changes almost as rapidly. New operating systems under development (e.g., Google's Fuchsia) are adding support for the development of native applications in JavaScript. All of this means that JavaScript has an exciting future. It's a great time to learn JavaScript.
  • 6. JavaScript basics Dept. of CSE, YCET Jammu 6