SlideShare a Scribd company logo
1 of 13
BY
G.GOWRILATHA,M.Sc(Info Tech)
Department Of CS & IT
Nadar Saraswathi College Of Arts and Science,
Theni.
JavaScript is a lightweight, interpreted
programming language. It is designed for
creating network-centric applications. It is
complimentary to and integrated with Java.
JavaScript is very easy to implement because
it is integrated with HTML. It is open and
cross-platform.
Java script is a dynamic computer programming language.
It is lightweight and most commonly used as a part of web
pages, whose implementations allow client-side script to
interact with the user and make dynamic pages. It is an
interpreted programming language with object-oriented
capabilities.
JavaScript was first known as Live Script, but Netscape
changed its name to JavaScript, possibly because of the
excitement being generated by Java.
Client-side JavaScript is the most common form of the
language. The script should be included in or referenced by
an HTML document for the code to be interpreted by the
browser.
 It means that a web page need not be a static HTML, but
can include programs that interact with the user, control the
browser, and dynamically create HTML content.
 The JavaScript client-side mechanism provides many
advantages over traditional CGI server-side scripts. For
example, you might use JavaScript to check if the user has
entered a valid e-mail address in a form field.
 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 sever.
 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 interface that
react when the user hovers over them with a mouse or
activates them via the keyboard.
 Richer interface: you can use java Script to include such
items as drag-and-drop components and sliders to give arch
interface to your site visitors.
The <script> tag alerts the browser program to start
interpreting all the text between these tags as a script.
The script tag takes two important attributes:
Language: This attribute specifies what scripting language
you are using. Typically, its value will be java script.
Type: This attribute is what is now recommended to
indicate the scripting language in use and its value should
be set to "text/java script".
<script ...>
JavaScript code
</script>
Java Script allows you to work with three primitive
data types:
 Numbers, eg.,123,120.50 etc.
 Strings of text , eg. “This text String” etc.
 Boolean, eg. True or false.
Java Script also defines two trivial data types, null and
undefined, each of which defines only a single value.
In addition to these primitive data types, JavaScript
supports a composite data type known as object.
,
Like many other programming languages, JavaScript has
variables. Variables can be thought of as named
containers. You can place data into these containers and
then refer to the data simply by naming the container.
Before you use a variable in a JavaScript program, you
must declare it. Variables are declared with the var
keyword as follows.
<script type=“text/javascript”>
<!—
Var money;
Var name;
//-->
</script>
The scope of a variable is the region of your program in
which it is defined. JavaScript variables have only two
scopes.
Global Variables: A global variable has global scope which
means it can be defined anywhere in your JavaScript code.
Local Variables: A local variable will be visible only within a
function where it is defined. Function parameters are
always local to that function.
Within the body of a function, a local variable takes
precedence over a global variable with the same name.
While naming your variables in JavaScript, keep the following
rules in mind.
 You should not use any of the JavaScript reserved keywords as a
variable name. These keywords are mentioned in the next
section. For example, break or Boolean variable names are not
valid.
 JavaScript variable names should not start with a numeral (0-9).
They must begin with a letter or an underscore character. For
example, 123test is an invalid variable name but _123test is a valid
one.
 JavaScript variable names are case-sensitive. For example, Name
and name are two different variables.
•There are three special values in JavaScript that are considered numbers
but
•don’t behave like normal numbers.
•The first two are Infinity and -Infinity, which represent the positive and
negative infinities. Infinity - 1 is still Infinity, and so on. Don’t put too
much trust in infinity-based computation, though. It isn’t
mathematically
sound, and it will quickly lead to the next special number: NaN.
•NaN stands for “not a number”, even though it is a value of the number
type.
•You’ll get this result when you, for example, try to calculate 0 / 0 (zero
divided
by zero), Infinity - Infinity, or any number of other numeric operations
that
don’t yield a meaningful result.
The next basic data type is the string. Strings are used to
represent text. They
are written by enclosing their content in quotes.
`Down on the sea`
"Lie on the ocean"
'Float on the ocean'
You can use single quotes, double quotes, or back ticks to
mark strings, as
long as the quotes at the start and the end of the string
match.
Java script

More Related Content

What's hot

Javascript
JavascriptJavascript
JavascriptIblesoft
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascriptambuj pathak
 
Basic JavaScript Tutorial
Basic JavaScript TutorialBasic JavaScript Tutorial
Basic JavaScript TutorialDHTMLExtreme
 
Scripting languages
Scripting languagesScripting languages
Scripting languagesteach4uin
 
Javascript survival for CSBN Sophomores
Javascript survival for CSBN SophomoresJavascript survival for CSBN Sophomores
Javascript survival for CSBN SophomoresAndy de Vera
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScriptMarlon Jamera
 
Introduction to java script
Introduction to java scriptIntroduction to java script
Introduction to java scriptDivyaKS12
 
Web development basics (Part-4)
Web development basics (Part-4)Web development basics (Part-4)
Web development basics (Part-4)Rajat Pratap Singh
 
1. java script language fundamentals
1. java script language fundamentals1. java script language fundamentals
1. java script language fundamentalsRajiv Gupta
 
Java Script
Java ScriptJava Script
Java Scriptsiddaram
 
2javascript web programming with JAVA script
2javascript web programming with JAVA script2javascript web programming with JAVA script
2javascript web programming with JAVA scriptumardanjumamaiwada
 
OLE-DB vs ODBC
OLE-DB vs ODBCOLE-DB vs ODBC
OLE-DB vs ODBCTom
 

What's hot (20)

Javascript
JavascriptJavascript
Javascript
 
Web programming
Web programmingWeb programming
Web programming
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
Java scripts
Java scriptsJava scripts
Java scripts
 
Basic JavaScript Tutorial
Basic JavaScript TutorialBasic JavaScript Tutorial
Basic JavaScript Tutorial
 
Scripting languages
Scripting languagesScripting languages
Scripting languages
 
Javascript survival for CSBN Sophomores
Javascript survival for CSBN SophomoresJavascript survival for CSBN Sophomores
Javascript survival for CSBN Sophomores
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Java Script ppt
Java Script pptJava Script ppt
Java Script ppt
 
Javascript functions
Javascript functionsJavascript functions
Javascript functions
 
Javascript
JavascriptJavascript
Javascript
 
Introduction to java script
Introduction to java scriptIntroduction to java script
Introduction to java script
 
Web development basics (Part-4)
Web development basics (Part-4)Web development basics (Part-4)
Web development basics (Part-4)
 
1. java script language fundamentals
1. java script language fundamentals1. java script language fundamentals
1. java script language fundamentals
 
Client side scripting
Client side scriptingClient side scripting
Client side scripting
 
Java script
Java scriptJava script
Java script
 
Java script basics
Java script basicsJava script basics
Java script basics
 
Java Script
Java ScriptJava Script
Java Script
 
2javascript web programming with JAVA script
2javascript web programming with JAVA script2javascript web programming with JAVA script
2javascript web programming with JAVA script
 
OLE-DB vs ODBC
OLE-DB vs ODBCOLE-DB vs ODBC
OLE-DB vs ODBC
 

Similar to Java script (20)

JavaScript New Tutorial Class XI and XII.pptx
JavaScript New Tutorial Class XI and XII.pptxJavaScript New Tutorial Class XI and XII.pptx
JavaScript New Tutorial Class XI and XII.pptx
 
Javascript tutorial basic for starter
Javascript tutorial basic for starterJavascript tutorial basic for starter
Javascript tutorial basic for starter
 
WTA-MODULE-4.pptx
WTA-MODULE-4.pptxWTA-MODULE-4.pptx
WTA-MODULE-4.pptx
 
chap04.ppt
chap04.pptchap04.ppt
chap04.ppt
 
WT Unit-3 PPT.pptx
WT Unit-3 PPT.pptxWT Unit-3 PPT.pptx
WT Unit-3 PPT.pptx
 
Java script Basic
Java script BasicJava script Basic
Java script Basic
 
Javascript - Ebook (A Quick Guide)
Javascript - Ebook (A Quick Guide)Javascript - Ebook (A Quick Guide)
Javascript - Ebook (A Quick Guide)
 
js.pptx
js.pptxjs.pptx
js.pptx
 
Introduction to JavaScript Programming
Introduction to JavaScript ProgrammingIntroduction to JavaScript Programming
Introduction to JavaScript Programming
 
WEB TECHNOLOGIES JavaScript
WEB TECHNOLOGIES JavaScriptWEB TECHNOLOGIES JavaScript
WEB TECHNOLOGIES JavaScript
 
Java Script An Introduction By HWA
Java Script An Introduction By HWAJava Script An Introduction By HWA
Java Script An Introduction By HWA
 
Unit 4 Java script.pptx
Unit 4 Java script.pptxUnit 4 Java script.pptx
Unit 4 Java script.pptx
 
Javascript tutorial
Javascript tutorialJavascript tutorial
Javascript tutorial
 
Introduction to JavaScript Programming
Introduction to JavaScript ProgrammingIntroduction to JavaScript Programming
Introduction to JavaScript Programming
 
t0526-2
t0526-2t0526-2
t0526-2
 
t0526-2
t0526-2t0526-2
t0526-2
 
JavaScript_III.pptx
JavaScript_III.pptxJavaScript_III.pptx
JavaScript_III.pptx
 
WEB MODULE 3.pdf
WEB MODULE 3.pdfWEB MODULE 3.pdf
WEB MODULE 3.pdf
 
Unit 2.5
Unit 2.5Unit 2.5
Unit 2.5
 
Iwt note(module 2)
Iwt note(module 2)Iwt note(module 2)
Iwt note(module 2)
 

More from GowriLatha1

Filtering in frequency domain
Filtering in frequency domainFiltering in frequency domain
Filtering in frequency domainGowriLatha1
 
Demand assigned and packet reservation multiple access
Demand assigned and packet reservation multiple accessDemand assigned and packet reservation multiple access
Demand assigned and packet reservation multiple accessGowriLatha1
 
Software engineering
Software engineeringSoftware engineering
Software engineeringGowriLatha1
 
Web services & com+ components
Web services & com+ componentsWeb services & com+ components
Web services & com+ componentsGowriLatha1
 
Comparison with Traditional databases
Comparison with Traditional databasesComparison with Traditional databases
Comparison with Traditional databasesGowriLatha1
 
Comparison with Traditional databases
Comparison with Traditional databasesComparison with Traditional databases
Comparison with Traditional databasesGowriLatha1
 
Inter process communication
Inter process communicationInter process communication
Inter process communicationGowriLatha1
 
computer network
computer networkcomputer network
computer networkGowriLatha1
 
Operating System
Operating SystemOperating System
Operating SystemGowriLatha1
 
Data mining query language
Data mining query languageData mining query language
Data mining query languageGowriLatha1
 
Path &amp; application(ds)2
Path &amp; application(ds)2Path &amp; application(ds)2
Path &amp; application(ds)2GowriLatha1
 

More from GowriLatha1 (20)

Filtering in frequency domain
Filtering in frequency domainFiltering in frequency domain
Filtering in frequency domain
 
Demand assigned and packet reservation multiple access
Demand assigned and packet reservation multiple accessDemand assigned and packet reservation multiple access
Demand assigned and packet reservation multiple access
 
Software engineering
Software engineeringSoftware engineering
Software engineering
 
Shadow paging
Shadow pagingShadow paging
Shadow paging
 
Multithreading
MultithreadingMultithreading
Multithreading
 
Hive
HiveHive
Hive
 
Web services & com+ components
Web services & com+ componentsWeb services & com+ components
Web services & com+ components
 
Comparison with Traditional databases
Comparison with Traditional databasesComparison with Traditional databases
Comparison with Traditional databases
 
Recovery system
Recovery systemRecovery system
Recovery system
 
Comparison with Traditional databases
Comparison with Traditional databasesComparison with Traditional databases
Comparison with Traditional databases
 
Static analysis
Static analysisStatic analysis
Static analysis
 
Hema dm
Hema dmHema dm
Hema dm
 
Data reduction
Data reductionData reduction
Data reduction
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
 
computer network
computer networkcomputer network
computer network
 
Operating System
Operating SystemOperating System
Operating System
 
Data mining query language
Data mining query languageData mining query language
Data mining query language
 
Enterprice java
Enterprice javaEnterprice java
Enterprice java
 
Ethernet
EthernetEthernet
Ethernet
 
Path &amp; application(ds)2
Path &amp; application(ds)2Path &amp; application(ds)2
Path &amp; application(ds)2
 

Recently uploaded

FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfstareducators107
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of PlayPooky Knightsmith
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesSHIVANANDaRV
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111GangaMaiya1
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningMarc Dusseiller Dusjagr
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 

Recently uploaded (20)

OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of Play
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food Additives
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 

Java script

  • 1. BY G.GOWRILATHA,M.Sc(Info Tech) Department Of CS & IT Nadar Saraswathi College Of Arts and Science, Theni.
  • 2. JavaScript is a lightweight, interpreted programming language. It is designed for creating network-centric applications. It is complimentary to and integrated with Java. JavaScript is very easy to implement because it is integrated with HTML. It is open and cross-platform.
  • 3. Java script is a dynamic computer programming language. It is lightweight and most commonly used as a part of web pages, whose implementations allow client-side script to interact with the user and make dynamic pages. It is an interpreted programming language with object-oriented capabilities. JavaScript was first known as Live Script, but Netscape changed its name to JavaScript, possibly because of the excitement being generated by Java.
  • 4. Client-side JavaScript is the most common form of the language. The script should be included in or referenced by an HTML document for the code to be interpreted by the browser.  It means that a web page need not be a static HTML, but can include programs that interact with the user, control the browser, and dynamically create HTML content.  The JavaScript client-side mechanism provides many advantages over traditional CGI server-side scripts. For example, you might use JavaScript to check if the user has entered a valid e-mail address in a form field.
  • 5.  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 sever.  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 interface that react when the user hovers over them with a mouse or activates them via the keyboard.  Richer interface: you can use java Script to include such items as drag-and-drop components and sliders to give arch interface to your site visitors.
  • 6. The <script> tag alerts the browser program to start interpreting all the text between these tags as a script. The script tag takes two important attributes: Language: This attribute specifies what scripting language you are using. Typically, its value will be java script. Type: This attribute is what is now recommended to indicate the scripting language in use and its value should be set to "text/java script". <script ...> JavaScript code </script>
  • 7. Java Script allows you to work with three primitive data types:  Numbers, eg.,123,120.50 etc.  Strings of text , eg. “This text String” etc.  Boolean, eg. True or false. Java Script also defines two trivial data types, null and undefined, each of which defines only a single value. In addition to these primitive data types, JavaScript supports a composite data type known as object. ,
  • 8. Like many other programming languages, JavaScript has variables. Variables can be thought of as named containers. You can place data into these containers and then refer to the data simply by naming the container. Before you use a variable in a JavaScript program, you must declare it. Variables are declared with the var keyword as follows. <script type=“text/javascript”> <!— Var money; Var name; //--> </script>
  • 9. The scope of a variable is the region of your program in which it is defined. JavaScript variables have only two scopes. Global Variables: A global variable has global scope which means it can be defined anywhere in your JavaScript code. Local Variables: A local variable will be visible only within a function where it is defined. Function parameters are always local to that function. Within the body of a function, a local variable takes precedence over a global variable with the same name.
  • 10. While naming your variables in JavaScript, keep the following rules in mind.  You should not use any of the JavaScript reserved keywords as a variable name. These keywords are mentioned in the next section. For example, break or Boolean variable names are not valid.  JavaScript variable names should not start with a numeral (0-9). They must begin with a letter or an underscore character. For example, 123test is an invalid variable name but _123test is a valid one.  JavaScript variable names are case-sensitive. For example, Name and name are two different variables.
  • 11. •There are three special values in JavaScript that are considered numbers but •don’t behave like normal numbers. •The first two are Infinity and -Infinity, which represent the positive and negative infinities. Infinity - 1 is still Infinity, and so on. Don’t put too much trust in infinity-based computation, though. It isn’t mathematically sound, and it will quickly lead to the next special number: NaN. •NaN stands for “not a number”, even though it is a value of the number type. •You’ll get this result when you, for example, try to calculate 0 / 0 (zero divided by zero), Infinity - Infinity, or any number of other numeric operations that don’t yield a meaningful result.
  • 12. The next basic data type is the string. Strings are used to represent text. They are written by enclosing their content in quotes. `Down on the sea` "Lie on the ocean" 'Float on the ocean' You can use single quotes, double quotes, or back ticks to mark strings, as long as the quotes at the start and the end of the string match.