0% found this document useful (0 votes)
3 views10 pages

JavaScript Basics Presentation1

This document provides an introduction to JavaScript, highlighting its role as a dynamic programming language used in web development. It covers key elements such as variable declaration, functions, and DOM manipulation, along with examples of basic operations and comparisons with Python. Additionally, it discusses common number functions and special cases like Infinity and NaN.

Uploaded by

arupghosh123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views10 pages

JavaScript Basics Presentation1

This document provides an introduction to JavaScript, highlighting its role as a dynamic programming language used in web development. It covers key elements such as variable declaration, functions, and DOM manipulation, along with examples of basic operations and comparisons with Python. Additionally, it discusses common number functions and special cases like Infinity and NaN.

Uploaded by

arupghosh123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Introduction to JavaScript – Getting

Started with Basics


What is JavaScript?

• Dynamic programming language


• Used in web development
• Runs in browser
JavaScript in Action (Example)

• HTML snippet with onclick buttons


• Functions: showMessage() and
changeBackgroundColor()
Key JavaScript Elements

• let, const, or var – variable declaration


• Functions & DOM manipulation
Welcome Alert & Button Demo

• alert("Welcome!") on load
• Changing text with innerText
Color Changing Example

• Random background color change


• Use of arrays and Math.random()
JavaScript vs Python – Numbers
Concept JavaScript Python
Variable Declaration let x = 5 x=5
Division 5 / 2 = 2.5 5 / 2 = 2.5 and //
Power x ** y, Math.pow x ** y
Square Root Math.sqrt(9) math.sqrt(9)
Common Number Functions

• Math.round(), Math.floor(), Math.abs()


• Example outputs from JS
Infinity & NaN

• 1 / 0 = Infinity
• "abc" * 2 = NaN
Summary

• JavaScript basics, syntax, and number


operations
• Comparison with Python

You might also like