Javascript

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 15

Eastern Visayas State University

Republic of the Philippines


EASTERN VISAYAS STATE UNIVERSITY
Tacloban City

College of Engineering
INFORMATION TECHNOLOGY DEPARTMENT

JavaScript Programming Language


Systems Integration and Architecture 2
REPORT DOCUMENTATION
School Year 2023-2024

Submitted by:
Kent Edward A. Sabulao
Welniño Baclayo
Christian Caysido

Submitted to:
Mr. Benito Badilla

1
TABLE OF CONTENTS

I. Introduction………………………………………………………………………..3

II. Inventors…………………………………………………………………………..5

III. Detailed History…………………………………………………………………..7

IV. Purpose……………………………………………………………………………9

V. The Unforeseen Use/ Current Use.………………………………………………11

VI. Conclusion/Review/Recommendation…….…………………………………….13

VII. Sample Code…….………………………………………………………………14

VIII. References……………………………………………………………………….15

IX.

2
I. INTRODUCTION

JavaScript, known as the world's most popular programming language, holds an

essential role in web development. As the programming language of the Web, JavaScript

empowers developers to create interactive and dynamic webpages, incorporating features

like complex animations, clickable buttons, and popup menus. Renowned for its

versatility, JavaScript transcends the confines of web browsers, finding utility in diverse

environments beyond traditional webpage scripting. Notably, advancements like Node.js

enable robust server-side functionalities, facilitating real-time collaboration and

enhancing website capabilities far beyond simple file handling.

At its core, JavaScript boasts a cross-platform, object-oriented architecture,

facilitating seamless integration with various host environments such as web browsers.

Through dynamic typing, JavaScript fosters flexibility, enabling developers to manipulate

environment objects programmatically. Leveraging a standard library replete with

essential objects and language elements, JavaScript empowers developers with a rich

toolset for crafting sophisticated applications. Moreover, its dual nature as both an

imperative and declarative language affords developers multiple paradigms for

expressing logic and achieving desired outcomes.

JavaScript's influence extends across client-side and server-side realms, catering

to diverse development needs. On the client side, JavaScript augments the core language

with DOM manipulation capabilities, enabling interactive user experiences and

responsive interfaces. Conversely, server-side JavaScript equips developers with tools for

seamless database communication, session management, and file operations, enhancing

3
application functionality and scalability. This duality underscores JavaScript's versatility,

making it a cornerstone of modern web development.

While bearing semblance to Java in syntax and naming conventions, JavaScript

distinguishes itself through its dynamic nature and liberal syntax. Unlike Java's stringent

class-based model, JavaScript embraces a more laissez-faire approach, eschewing explicit

type declarations and rigid class hierarchies. This flexibility simplifies development,

sparing developers from concerns about access modifiers and interface implementations.

Thus, while JavaScript and Java share similarities, their fundamental differences

underscore each language's unique strengths and suitability for distinct programming

paradigms.

4
II. INVENTORS

Brendan Eich, an American computer programmer and technology executive,

stands as the visionary behind the inception of JavaScript in 1995. During his tenure at

Netscape Communications Corporation, Eich undertook the monumental task of crafting

a scripting language that would revolutionize web development. His endeavor culminated

in the birth of JavaScript, a dynamic and versatile programming language designed to

empower web developers with the ability to infuse their websites with interactive

elements and dynamic content. Eich's pioneering work laid the foundation for a new era

of web development, ushering in a paradigm shift in how websites were designed and

experienced.

As the primary creator of JavaScript, Eich's expertise and ingenuity were pivotal

in shaping the language into the influential force it became. While leading the

development efforts at Netscape, Eich collaborated with esteemed engineers such as

Marc Andreessen, co-founder of Netscape, and other talented members of the Netscape

development team. Together, they worked tirelessly to refine and enhance JavaScript,

leveraging their collective expertise to overcome technical challenges and push the

boundaries of web innovation. However, it was Eich's singular vision and unwavering

dedication that propelled JavaScript from concept to reality, cementing its status as the

cornerstone of modern web development.

Following the establishment of JavaScript as a pivotal component of Netscape

Navigator, the language continued to evolve under the stewardship of the Mozilla

Foundation. Eich's enduring commitment to advancing web technologies led him to co-

5
found the Mozilla project, the Mozilla Foundation, and the Mozilla Corporation. Despite

facing challenges, including controversies surrounding his personal beliefs, Eich's

contributions to the technology landscape remain indelible. His legacy as the creator of

JavaScript endures, underscoring the profound impact of his work on shaping the digital

landscape of the 21st century.

6
III. DETAILED HISTORY

Originally named Mocha, then LiveScript, and finally settling on JavaScript, this

language was meant to bring life to static HTML pages by adding dynamic and

interactive elements. JavaScript found its first home in Netscape Navigator, the top

browser at the time. Its simplicity and the lack of alternatives led Microsoft to quickly

adopt it for Internet Explorer. Over time, JavaScript became a cornerstone of web

development, powering everything from online games to interactive menus and forms.

However, plans to evolve the language with ECMAScript 4 in 2002 were scrapped due to

disagreements among browser makers.

Since it was first released in 1995, the JavaScript language has undergone a

number of revisions, each of which has contributed new features and syntax.

Version Name Release Features


Year
ES1 ECMAScript 1 1997 Initial Release
ES2 ECMAScript 2 1998 Minor Editorial Changes
ES3 ECMAScript 3 1999 Added:
• Regular Expression
• try/catch
• Exception Handling
• switch case & do-while
ES4 ECMAScript 4 Abandoned due to conflicts
ES5 ECMAScript 5 2009 Added:
• JavaScript “strict mode”
• JSON support
• JS getters and setters
ES6 ECMAScript 2015 2015 Added:
• let and const
• class declaration
• import and export
• for..of loop
• Arrow functions

7
ES7 ECMAScript 2016 2016 Added:
• Block scope for variable
• async/await
• Array.includes fuction
• Exponentiation Operator
ES8 ECMAScript 2017 2017 Added:
• Object.values
• Object.entries
• Object.getOwnPropertiesDescription

ES9 ECMAScript 2018 2018 Added:


• spread operator
• rest parameters
ES10 ECMAScript 2019 2019 Added:
• Array.flat()
• Array.flatMap()
• Array.sort is now stable
ES11 ECMAScript 2020 2020 Added:
• BigInt primitive type
• nullish coalescing operator
ES12 ECMAScript 2021 2021 Added:
• String.replaceAll() Method
• Promise.any() Method
ES13 ECMAScript 2022 2022 Added:
• Top-level await
• New class elements
• Static block inside classes
ES14 ECMAScript 2023 2023 Added:
• toSorted method
• toReversed
• findLast, and findLastIndex methods
on Array.prototype and
TypedArray.prototypet

8
IV. PURPOSE

JavaScript was invented to add interactivity and dynamic behavior to web pages.

When the World Wide Web was still in its infancy, web pages were mostly static,

displaying text and images without much user interaction.

The purpose of JavaScript is to enable developers to create dynamic, interactive

web pages that respond to user actions without needing to reload the entire page from the

server. With JavaScript, developers can:

1. Manipulate HTML and CSS: JavaScript allows developers to dynamically

change the content, structure, and style of a web page in response to user

interactions or other events.

2. Handle User Events: JavaScript can respond to user actions such as clicks,

mouse movements, keyboard input, and form submissions, enabling developers to

create interactive user interfaces.

3. Perform Client-Side Validation: JavaScript can validate user input on the client

side before submitting it to the server, providing immediate feedback to users and

reducing the load on the server.

4. Communicate with Servers: JavaScript can make asynchronous requests to

servers using techniques such as AJAX (Asynchronous JavaScript and XML) to

fetch data and update parts of a web page without requiring a full page reload.

9
5. Create Cookies and Local Storage: JavaScript can store data on the client-side

using cookies or local storage, allowing developers to maintain state and

personalize the user experience.

6. Build Web Applications: JavaScript is essential for building modern web

applications, including single-page applications (SPAs) and progressive web apps

(PWAs), which offer a more responsive and app-like user experience.

V. THE UNFORESEEN USE / CURRENT USE:

10
JavaScript is widely utilized by programmers globally to craft dynamic and

engaging web content such as applications and browsers. It's incredibly popular, being

the primary programming language for 97.0% of websites. Unlike server-side languages,

JavaScript operates on the user's computer, enabling interactive experiences directly

within the web browser. It's not limited to web development; JavaScript is versatile and

finds application in various domains, including software, hardware controls, and servers.

Due to its native integration with web browsers, JavaScript is renowned for its

effectiveness in web-based environments, akin to how native English speakers

effortlessly understand English.

Creating Interactive Websites

JavaScript makes web pages dynamic. Before JavaScript, web pages were built only with

HTML and CSS. HTML and CSS are only capable of creating static pages that can be

styled but not interactive aside from hyperlinks. Some of the most popular websites are

built with JavaScript, including Google, YouTube, and Facebook.

Building Applications

With JavaScript’s extensive collection of frameworks, developers can efficiently build

apps for mobile and web. Frameworks are libraries of pre-written JavaScript code that

developers use for standard features. You can think of a JavaScript framework like a

blueprint. Facebook built React and React Native, which are currently powering some of

the world’s most powerful social media applications. React is used by websites like Uber,

Pinterest, Netflix, Instagram, Amazon, Twitter, Udemy, and more. Facebook, Instagram,

11
Shopify, Words with Friends, Skype, Pinterest, Discord, Tesla, and Uber Eats use React

Native.

Developing Engaging Games

JavaScript is frequently used to create in-browser games. Developers use JavaScript to

create 2D and 3D puzzles, role-playing games, racing games, platform games, and more.

There are hundreds of JavaScript game engines that provide frameworks for buidling

games, and many are free and open-source. The most popular game engines include

Backbone, DarlingJS, and JawsJS.

Popular browser-based games built using JavaScript:

 Angry Birds

 2048

 Little Alchemy

 Polycraft

 HexGL

 CrossCode

 Bejeweled

 Gods Will be Watching

12
VI. CONCLUSION / REVIEW / RECOMMENDATION:

In conclusion, JavaScript stands as a cornerstone of modern web development,

revolutionizing the digital landscape with its dynamic capabilities and versatility.

Originally conceived to breathe life into static web pages, JavaScript has evolved into the

world's most widely used programming language, powering 97.0% of websites

worldwide. Its role extends far beyond web browsers, finding applications in software,

hardware controls, servers, and even game development.

JavaScript's journey began with Brendan Eich's visionary creation in 1995,

marking a pivotal moment in web history. Eich's pioneering efforts, coupled with

collaborative contributions from esteemed engineers, propelled JavaScript into

prominence, shaping its evolution and ensuring its enduring relevance.

The language's dynamic nature and liberal syntax have facilitated its widespread

adoption, enabling developers to craft interactive websites, sophisticated applications,

and engaging games with ease. JavaScript's continuous evolution, marked by successive

versions and updates, has expanded its capabilities, introducing new features and syntax

to meet the evolving needs of developers.

Today, JavaScript empowers developers worldwide to create interactive user

experiences, build robust applications, and unleash creativity in web development. Its

ubiquitous presence underscores its indispensable role in shaping the digital experiences

of billions of users across the globe, ensuring JavaScript remains a driving force in the

ever-evolving landscape of technology.

13
VII. SAMPLE CODE

Program to find the HCF or GCD of two integers

// take input
let number1 = prompt('Enter a first positive integer: ');
let number2 = prompt('Enter a second positive integer: ');

// looping until both numbers are equal


while(number1 != number2){
if(number1 > number2) {
number1 -= number2;
}
else {
number2 -= number1;
}
}

// display the hcf


console.log(`HCF is ${number1}`);

Sample Output:

Enter a first integer: 60


Enter a second integer: 72
HCF is 12

14
REFERENCES:
1. https://www.w3schools.com/js/default.asp
2. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Introduction
3. https://www.geeksforgeeks.org/introduction-to-javascript/
4. https://www.w3schools.com/js/js_history.asp#:~:text=JavaScript%20was
%20invented%20by%20Brendan,JavaScript%20for%20the%20Firefox
%20browser.
5. https://en.wikipedia.org/wiki/Brendan_Eich
6. https://www.geeksforgeeks.org/history-of-javascript/
7. https://www.geeksforgeeks.org/javascript-versions/
8. https://www.lighthouselabs.ca/en/blog/what-is-javascript-used-
for#:~:text=Javascript%20is%20used%20by%20programmers,by
%2097.0%25%20of%20all%20websites.

15

You might also like