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.