SlideShare a Scribd company logo
WWW.IPRISMTECH.COM
www.iprismtech.com

 JavaScript ("JS" for short) is a full-fledged dynamic programming language that, when
applied to an HTML document, can provide dynamic interactivity on websites. It was
invented by Brendan Eich, co-founder of the Mozilla project, the Mozilla Foundation,
and the Mozilla Corporation.
 JavaScript is incredibly versatile. You can start small, with carousels, image galleries,
fluctuating layouts, and responses to button clicks. With more experience you'll be
able to create games, animated 2D and 3D graphics, comprehensive database-driven
apps, and much more!
What is JavaScript, really?
www.iprismtech.com
 JavaScript itself is fairly compact yet very flexible. Developers have
written a large variety of tools complementing the core JavaScript
language, unlocking a vast amount of extra functionality with minimum
effort. These include:
 Application Programming Interfaces (APIs) built into web browsers,
providing functionality like dynamically creating HTML and setting CSS
styles, collecting and manipulating a video stream from the user's
webcam, or generating 3D graphics and audio samples.
 Third-party APIs to allow developers to incorporate functionality in their
sites from other content providers, such as Twitter or Facebook.
 Third-party frameworks and libraries you can apply to your HTML to
allow you to rapidly build up sites and applications.
www.iprismtech.com

 First, go to your test site and create a new file called main.js. Save it in
your scripts folder.
 Next, in your index.html file enter the following element on a new line
just before the closing </body> tag:<script
src="scripts/main.js"></script>
 This is basically doing the same job as the <link> element for CSS — it
applies the JavaScript to the page, so it can have an effect on the HTML
(along with the CSS, and anything else on the page).
 Now add the following code to the main.js file:var myHeading =
document.querySelector('h1'); myHeading.textContent = 'Hello world!';
 Finally, make sure the HTML and JavaScript files are saved, and
load index.html in the browser.
A "hello world" example
www.iprismtech.com

 Your heading text has now been changed to "Hello world!" using JavaScript.
You did this by first using a function called querySelector() to grab a
reference to your heading, and store it in a variable called myHeading. This
is very similar to what we did using CSS selectors. When wanting to do
something to an element, you first need to select it.
 After that, you set the value of
the myHeading variable's textContent property (which represents the
content of the heading) to "Hello world!".
What happened?
www.iprismtech.com

 Let's explain some of the basic features of the JavaScript language, to give
you greater understanding of how it all works. Better yet, these features are
common to all programming languages. If you master these fundamentals,
you're on your way to being able to programme just about anything!
Language basics crash course
www.iprismtech.com
 Variables are containers that you can store values in. You start by declaring a
variable with the var keyword, followed by any name you want to call it:
 var myVariable;Note: All statements in JavaScript must end with a semi-colon, to
indicate that this is where the statement ends. If you don't include these, you can
get unexpected results.
 Note: You can name a variable nearly anything, but there are some name
restrictions (see this article on variable naming rules.) If you are unsure, you
can check your variable name to see if it is valid.
 Note: JavaScript is case sensitive — myVariable is a different variable
to myvariable. If you are getting problems in your code, check the casing!
 After declaring a variable, you can give it a value:
 myVariable = 'Bob';You can do both these operations on the same line if you wish:
 var myVariable = 'Bob';You can retrieve the value by just calling the variable by
name:
 myVariable;After giving a variable a value, you can later choose to change it:
 var myVariable = 'Bob'; myVariable = 'Steve';
Variables
www.iprismtech.com
Variable Explanation Example
String
A sequence of text
known as a string. To
signify that the
variable is a string,
you should enclose it
in quote marks.
var myVariable =
'Bob';
Number
A number. Numbers
don't have quotes
around them.
var myVariable = 10;
Boolean
A True/False value.
The
words trueand false ar
e special keywords in
JS, and don't need
quotes.
var myVariable = true;
Array
A structure that allows
you to store multiple
values in one single
reference.
var myVariable =
[1,'Bob','Steve',10];
Refer to each member
of the array like this:
myVariable[0], myVari
able[1], etc.
Object
Basically, anything.
Everything in
JavaScript is an object,
and can be stored in a
variable. Keep this in
mind as you learn.
var myVariable =
document.querySelect
or('h1');
All of the above
examples too.
DATA TYPES
www.iprismtech.com

 You can put comments into JavaScript code, just as you can in CSS:
 /* Everything in between is a comment. */If your comment contains no line
breaks, it's often easier to put it behind two slashes like this:
 // This is a comment
Comments
www.iprismtech.com

 An operator is a mathematical symbol which produces a result based on two
values (or variables). In the following table you can see some of the simplest
operators, along with some examples to try out in the JavaScript console.
Operators
Operator Explanation Symbol(s) Example
add/concatenati
on
Used to add two
numbers
together, or glue
two strings
together.
+
6 + 9;
"Hello " +
"world!";
subtract,
multiply, divide
These do what
you'd expect
them to do in
basic math.
-, *, /
9 - 3;
8 * 2; // multiply
in JS is an asterisk
9 / 3;
assignment
operator
You've seen this
already: it assigns
a value to a
variable.
=
var myVariable =
'Bob';
www.iprismtech.com

 Identity operator Does a test to see if two values are equal to one
another, and returns a true/false (Boolean) result. === var
myVariable = 3;
 myVariable === 4;
 Negation, not equal Returns the logically opposite value of what it
precedes; it turns a true into a false, etc. When it is used alongside the
Equality operator, the negation operator tests whether two values are not
equal. !, !==
 The basic expression is true, but the comparison returns false because we've
negated it:
 var myVariable = 3;
 !(myVariable === 3);
 Here we are testing "is myVariable NOT equal to 3". This returns false
because myVariable IS equal to 3.
 var myVariable = 3;
 myVariable !== 3;
www.iprismtech.com

 Conditionals are code structures which allow you to test if an expression
returns true or not, running alternative code revealed by its result. The
most common form of conditional is called if ... else. So for example:
 var iceCream = 'chocolate'; if (iceCream === 'chocolate') { alert('Yay, I
love chocolate ice cream!'); } else { alert('Awwww, but chocolate is my
favorite...'); }The expression inside the if ( ... ) is the test — this uses the
identity operator (as described above) to compare the
variable iceCream with the string chocolate to see if the two are equal. If
this comparison returns true, the first block of code is run. If the
comparison is not true, the first block is skipped and the second code
block, after the elsestatement, is run instead.
Conditionals
www.iprismtech.com
 Functions are a way of packaging functionality that you wish to reuse. When
you need the procedure you can call a function, with the function name,
instead of rewriting the entire code each time. You have already seen some
uses of functions above, for example:
 var myVariable = document.querySelector('h1');
 alert('hello!');
 These functions, document.querySelector and alert, are built into the
browser for you to use whenever you desire.
 If you see something which looks like a variable name, but has brackets —
() — after it, it is likely a function. Functions often take arguments — bits of
data they need to do their job. These go inside the brackets, separated by
commas if there is more than one argument.
 For example, the alert() function makes a pop-up box appear inside the
browser window, but we need to give it a string as an argument to tell the
function what to write in the pop-up box.
Functions
www.iprismtech.com

 The good news is you can define your own functions — in this next example
we write a simple function which takes two numbers as arguments and
multiplies them:
 function multiply(num1,num2) { var result = num1 * num2; return result;
}Try running the above function in the console, then test with several
arguments. For example:
 multiply(4,7); multiply(20,20); multiply(0.5,3);
www.iprismtech.com
 Real interactivity on a website needs events. These are code structures which
listen for things happening in browser, running code in response. The most
obvious example is the click event, which is fired by the browser when you
click on something with your mouse. To demonstrate this, enter the
following into your console, then click on the current webpage:
 document.querySelector('html').onclick = function() { alert('Ouch! Stop
poking me!'); }There are many ways to attach an event to an element.
Here we select the HTML element, setting its onclick handler property equal
to an anonymous (i.e. nameless) function, which contains the code we want
the click event to run.
 Note that
 document.querySelector('html').onclick = function() {};is equivalent to
 var myHTML = document.querySelector('html'); myHTML.onclick =
function() {};
 It's just shorter.
Events
www.iprismtech.com

 iPrism Technologies
 Contact-+918885617929
 Email-id: sales@iprismtech.com
Thank you
www.iprismtech.com

More Related Content

What's hot

Fundamental JavaScript [In Control 2009]
Fundamental JavaScript [In Control 2009]Fundamental JavaScript [In Control 2009]
Fundamental JavaScript [In Control 2009]
Aaron Gustafson
 
Java script basics
Java script basicsJava script basics
Java script basics
Thakur Amit Tomer
 
Secrets of JavaScript Libraries
Secrets of JavaScript LibrariesSecrets of JavaScript Libraries
Secrets of JavaScript Libraries
jeresig
 
Learn javascript easy steps
Learn javascript easy stepsLearn javascript easy steps
Learn javascript easy steps
prince Loffar
 
JavaScript Best Pratices
JavaScript Best PraticesJavaScript Best Pratices
JavaScript Best Pratices
ChengHui Weng
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to Javascript
Walid Ashraf
 
Design patterns in java script, jquery, angularjs
Design patterns in java script, jquery, angularjsDesign patterns in java script, jquery, angularjs
Design patterns in java script, jquery, angularjs
Ravi Bhadauria
 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScript
Bala Narayanan
 
Javascript Best Practices
Javascript Best PracticesJavascript Best Practices
Javascript Best Practices
Christian Heilmann
 
JavaScript Fundamentals & JQuery
JavaScript Fundamentals & JQueryJavaScript Fundamentals & JQuery
JavaScript Fundamentals & JQueryJamshid Hashimi
 
1. java script language fundamentals
1. java script language fundamentals1. java script language fundamentals
1. java script language fundamentals
Rajiv Gupta
 
Patterns for JVM languages - Geecon 2014
Patterns for JVM languages - Geecon 2014Patterns for JVM languages - Geecon 2014
Patterns for JVM languages - Geecon 2014
Jaroslaw Palka
 
Javascript
JavascriptJavascript
Javascript
mussawir20
 
JavaScript Tutorial
JavaScript  TutorialJavaScript  Tutorial
JavaScript Tutorial
Bui Kiet
 
JavaScript Workshop
JavaScript WorkshopJavaScript Workshop
JavaScript Workshop
Pamela Fox
 
Advisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScriptAdvisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScriptdominion
 
Angular Mini-Challenges
Angular Mini-ChallengesAngular Mini-Challenges
Angular Mini-Challenges
Jose Mendez
 
Java script
Java scriptJava script
Java script
Jay Patel
 
МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS» QADay 2019
МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS»  QADay 2019МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS»  QADay 2019
МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS» QADay 2019
QADay
 
JavaScript: DOM and jQuery
JavaScript: DOM and jQueryJavaScript: DOM and jQuery
JavaScript: DOM and jQuery
維佋 唐
 

What's hot (20)

Fundamental JavaScript [In Control 2009]
Fundamental JavaScript [In Control 2009]Fundamental JavaScript [In Control 2009]
Fundamental JavaScript [In Control 2009]
 
Java script basics
Java script basicsJava script basics
Java script basics
 
Secrets of JavaScript Libraries
Secrets of JavaScript LibrariesSecrets of JavaScript Libraries
Secrets of JavaScript Libraries
 
Learn javascript easy steps
Learn javascript easy stepsLearn javascript easy steps
Learn javascript easy steps
 
JavaScript Best Pratices
JavaScript Best PraticesJavaScript Best Pratices
JavaScript Best Pratices
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to Javascript
 
Design patterns in java script, jquery, angularjs
Design patterns in java script, jquery, angularjsDesign patterns in java script, jquery, angularjs
Design patterns in java script, jquery, angularjs
 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScript
 
Javascript Best Practices
Javascript Best PracticesJavascript Best Practices
Javascript Best Practices
 
JavaScript Fundamentals & JQuery
JavaScript Fundamentals & JQueryJavaScript Fundamentals & JQuery
JavaScript Fundamentals & JQuery
 
1. java script language fundamentals
1. java script language fundamentals1. java script language fundamentals
1. java script language fundamentals
 
Patterns for JVM languages - Geecon 2014
Patterns for JVM languages - Geecon 2014Patterns for JVM languages - Geecon 2014
Patterns for JVM languages - Geecon 2014
 
Javascript
JavascriptJavascript
Javascript
 
JavaScript Tutorial
JavaScript  TutorialJavaScript  Tutorial
JavaScript Tutorial
 
JavaScript Workshop
JavaScript WorkshopJavaScript Workshop
JavaScript Workshop
 
Advisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScriptAdvisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScript
 
Angular Mini-Challenges
Angular Mini-ChallengesAngular Mini-Challenges
Angular Mini-Challenges
 
Java script
Java scriptJava script
Java script
 
МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS» QADay 2019
МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS»  QADay 2019МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS»  QADay 2019
МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS» QADay 2019
 
JavaScript: DOM and jQuery
JavaScript: DOM and jQueryJavaScript: DOM and jQuery
JavaScript: DOM and jQuery
 

Viewers also liked

Usaha kecil menengah( ukm ) erlina risnandari 11140131 ( 12 )
Usaha kecil menengah( ukm )  erlina   risnandari 11140131 ( 12 )Usaha kecil menengah( ukm )  erlina   risnandari 11140131 ( 12 )
Usaha kecil menengah( ukm ) erlina risnandari 11140131 ( 12 )
erlina risnandari
 
Cuestionario Bransford
Cuestionario BransfordCuestionario Bransford
Cuestionario Bransford
Dianita Cuamatzi
 
Photobook
PhotobookPhotobook
Photobook
John Siew
 
Historia a través de ideas
Historia a través de ideasHistoria a través de ideas
Historia a través de ideashumanismo
 
Proyecto sena blog blogger blogspot
Proyecto sena blog blogger blogspotProyecto sena blog blogger blogspot
Proyecto sena blog blogger blogspotabacevedo
 
Kamil Presentation final
Kamil Presentation finalKamil Presentation final
Kamil Presentation finalKamil Sardar
 
Programa electoral PABA 2011
Programa electoral PABA 2011Programa electoral PABA 2011
Programa electoral PABA 2011
Antonio Gálvez
 
Guia instalacion gretl
Guia instalacion gretlGuia instalacion gretl
Guia instalacion gretl
luisperdices
 
外贸企业网站的定位和呈现(外贸企业定位)
外贸企业网站的定位和呈现(外贸企业定位)外贸企业网站的定位和呈现(外贸企业定位)
外贸企业网站的定位和呈现(外贸企业定位)
Lawrence Sun
 
Formación en didáctica tic. educación infantil
Formación en didáctica tic. educación infantilFormación en didáctica tic. educación infantil
Formación en didáctica tic. educación infantilMarisol Tejada Ruiz
 
Bidang Garapan Personalia
Bidang Garapan PersonaliaBidang Garapan Personalia
Bidang Garapan Personalia
Fitria Kusuma Wati
 

Viewers also liked (13)

YASH.DOCX
YASH.DOCXYASH.DOCX
YASH.DOCX
 
Usaha kecil menengah( ukm ) erlina risnandari 11140131 ( 12 )
Usaha kecil menengah( ukm )  erlina   risnandari 11140131 ( 12 )Usaha kecil menengah( ukm )  erlina   risnandari 11140131 ( 12 )
Usaha kecil menengah( ukm ) erlina risnandari 11140131 ( 12 )
 
Evaluación diagnóstica por escuela
Evaluación diagnóstica por escuelaEvaluación diagnóstica por escuela
Evaluación diagnóstica por escuela
 
Cuestionario Bransford
Cuestionario BransfordCuestionario Bransford
Cuestionario Bransford
 
Photobook
PhotobookPhotobook
Photobook
 
Historia a través de ideas
Historia a través de ideasHistoria a través de ideas
Historia a través de ideas
 
Proyecto sena blog blogger blogspot
Proyecto sena blog blogger blogspotProyecto sena blog blogger blogspot
Proyecto sena blog blogger blogspot
 
Kamil Presentation final
Kamil Presentation finalKamil Presentation final
Kamil Presentation final
 
Programa electoral PABA 2011
Programa electoral PABA 2011Programa electoral PABA 2011
Programa electoral PABA 2011
 
Guia instalacion gretl
Guia instalacion gretlGuia instalacion gretl
Guia instalacion gretl
 
外贸企业网站的定位和呈现(外贸企业定位)
外贸企业网站的定位和呈现(外贸企业定位)外贸企业网站的定位和呈现(外贸企业定位)
外贸企业网站的定位和呈现(外贸企业定位)
 
Formación en didáctica tic. educación infantil
Formación en didáctica tic. educación infantilFormación en didáctica tic. educación infantil
Formación en didáctica tic. educación infantil
 
Bidang Garapan Personalia
Bidang Garapan PersonaliaBidang Garapan Personalia
Bidang Garapan Personalia
 

Similar to Java script basics

Web programming
Web programmingWeb programming
Web programming
Leo Mark Villar
 
Javascript sivasoft
Javascript sivasoftJavascript sivasoft
Javascript sivasoftch samaram
 
ABCs of Programming_eBook Contents
ABCs of Programming_eBook ContentsABCs of Programming_eBook Contents
ABCs of Programming_eBook ContentsAshley Menhennett
 
Java Script ppt
Java Script pptJava Script ppt
Java Script ppt
Priya Goyal
 
CSC PPT 12.pptx
CSC PPT 12.pptxCSC PPT 12.pptx
CSC PPT 12.pptx
DrRavneetSingh
 
Ch3- Java Script.pdf
Ch3- Java Script.pdfCh3- Java Script.pdf
Ch3- Java Script.pdf
HASENSEID
 
JavaScript Lecture notes.pptx
JavaScript Lecture notes.pptxJavaScript Lecture notes.pptx
JavaScript Lecture notes.pptx
NishaRohit6
 
8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation
JohnLagman3
 
wp-UNIT_III.pptx
wp-UNIT_III.pptxwp-UNIT_III.pptx
wp-UNIT_III.pptx
GANDHAMKUMAR2
 
JavaScript
JavaScriptJavaScript
JavaScript
Ivano Malavolta
 
Web designing unit 4
Web designing unit 4Web designing unit 4
Web designing unit 4
SURBHI SAROHA
 
My 70-480 HTML5 certification learning
My 70-480 HTML5 certification learningMy 70-480 HTML5 certification learning
My 70-480 HTML5 certification learning
Syed Irtaza Ali
 
Javascript
JavascriptJavascript
Javascript
orestJump
 
Basic Java script handouts for students
Basic Java script handouts for students Basic Java script handouts for students
Basic Java script handouts for students
shafiq sangi
 
Javascript
JavascriptJavascript
Javascript
Nagarajan
 
Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]srikanthbkm
 
Javascript - Ebook (A Quick Guide)
Javascript - Ebook (A Quick Guide)Javascript - Ebook (A Quick Guide)
Javascript - Ebook (A Quick Guide)
sourav newatia
 

Similar to Java script basics (20)

Web programming
Web programmingWeb programming
Web programming
 
Javascript sivasoft
Javascript sivasoftJavascript sivasoft
Javascript sivasoft
 
Unit 2.4
Unit 2.4Unit 2.4
Unit 2.4
 
ABCs of Programming_eBook Contents
ABCs of Programming_eBook ContentsABCs of Programming_eBook Contents
ABCs of Programming_eBook Contents
 
Java Script ppt
Java Script pptJava Script ppt
Java Script ppt
 
CSC PPT 12.pptx
CSC PPT 12.pptxCSC PPT 12.pptx
CSC PPT 12.pptx
 
Ch3- Java Script.pdf
Ch3- Java Script.pdfCh3- Java Script.pdf
Ch3- Java Script.pdf
 
JavaScript Lecture notes.pptx
JavaScript Lecture notes.pptxJavaScript Lecture notes.pptx
JavaScript Lecture notes.pptx
 
Unit 2.4
Unit 2.4Unit 2.4
Unit 2.4
 
8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation
 
wp-UNIT_III.pptx
wp-UNIT_III.pptxwp-UNIT_III.pptx
wp-UNIT_III.pptx
 
Html JavaScript and CSS
Html JavaScript and CSSHtml JavaScript and CSS
Html JavaScript and CSS
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Web designing unit 4
Web designing unit 4Web designing unit 4
Web designing unit 4
 
My 70-480 HTML5 certification learning
My 70-480 HTML5 certification learningMy 70-480 HTML5 certification learning
My 70-480 HTML5 certification learning
 
Javascript
JavascriptJavascript
Javascript
 
Basic Java script handouts for students
Basic Java script handouts for students Basic Java script handouts for students
Basic Java script handouts for students
 
Javascript
JavascriptJavascript
Javascript
 
Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]
 
Javascript - Ebook (A Quick Guide)
Javascript - Ebook (A Quick Guide)Javascript - Ebook (A Quick Guide)
Javascript - Ebook (A Quick Guide)
 

Recently uploaded

Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 

Recently uploaded (20)

Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 

Java script basics

  • 2.   JavaScript ("JS" for short) is a full-fledged dynamic programming language that, when applied to an HTML document, can provide dynamic interactivity on websites. It was invented by Brendan Eich, co-founder of the Mozilla project, the Mozilla Foundation, and the Mozilla Corporation.  JavaScript is incredibly versatile. You can start small, with carousels, image galleries, fluctuating layouts, and responses to button clicks. With more experience you'll be able to create games, animated 2D and 3D graphics, comprehensive database-driven apps, and much more! What is JavaScript, really? www.iprismtech.com
  • 3.  JavaScript itself is fairly compact yet very flexible. Developers have written a large variety of tools complementing the core JavaScript language, unlocking a vast amount of extra functionality with minimum effort. These include:  Application Programming Interfaces (APIs) built into web browsers, providing functionality like dynamically creating HTML and setting CSS styles, collecting and manipulating a video stream from the user's webcam, or generating 3D graphics and audio samples.  Third-party APIs to allow developers to incorporate functionality in their sites from other content providers, such as Twitter or Facebook.  Third-party frameworks and libraries you can apply to your HTML to allow you to rapidly build up sites and applications. www.iprismtech.com
  • 4.   First, go to your test site and create a new file called main.js. Save it in your scripts folder.  Next, in your index.html file enter the following element on a new line just before the closing </body> tag:<script src="scripts/main.js"></script>  This is basically doing the same job as the <link> element for CSS — it applies the JavaScript to the page, so it can have an effect on the HTML (along with the CSS, and anything else on the page).  Now add the following code to the main.js file:var myHeading = document.querySelector('h1'); myHeading.textContent = 'Hello world!';  Finally, make sure the HTML and JavaScript files are saved, and load index.html in the browser. A "hello world" example www.iprismtech.com
  • 5.   Your heading text has now been changed to "Hello world!" using JavaScript. You did this by first using a function called querySelector() to grab a reference to your heading, and store it in a variable called myHeading. This is very similar to what we did using CSS selectors. When wanting to do something to an element, you first need to select it.  After that, you set the value of the myHeading variable's textContent property (which represents the content of the heading) to "Hello world!". What happened? www.iprismtech.com
  • 6.   Let's explain some of the basic features of the JavaScript language, to give you greater understanding of how it all works. Better yet, these features are common to all programming languages. If you master these fundamentals, you're on your way to being able to programme just about anything! Language basics crash course www.iprismtech.com
  • 7.  Variables are containers that you can store values in. You start by declaring a variable with the var keyword, followed by any name you want to call it:  var myVariable;Note: All statements in JavaScript must end with a semi-colon, to indicate that this is where the statement ends. If you don't include these, you can get unexpected results.  Note: You can name a variable nearly anything, but there are some name restrictions (see this article on variable naming rules.) If you are unsure, you can check your variable name to see if it is valid.  Note: JavaScript is case sensitive — myVariable is a different variable to myvariable. If you are getting problems in your code, check the casing!  After declaring a variable, you can give it a value:  myVariable = 'Bob';You can do both these operations on the same line if you wish:  var myVariable = 'Bob';You can retrieve the value by just calling the variable by name:  myVariable;After giving a variable a value, you can later choose to change it:  var myVariable = 'Bob'; myVariable = 'Steve'; Variables www.iprismtech.com
  • 8. Variable Explanation Example String A sequence of text known as a string. To signify that the variable is a string, you should enclose it in quote marks. var myVariable = 'Bob'; Number A number. Numbers don't have quotes around them. var myVariable = 10; Boolean A True/False value. The words trueand false ar e special keywords in JS, and don't need quotes. var myVariable = true; Array A structure that allows you to store multiple values in one single reference. var myVariable = [1,'Bob','Steve',10]; Refer to each member of the array like this: myVariable[0], myVari able[1], etc. Object Basically, anything. Everything in JavaScript is an object, and can be stored in a variable. Keep this in mind as you learn. var myVariable = document.querySelect or('h1'); All of the above examples too. DATA TYPES www.iprismtech.com
  • 9.   You can put comments into JavaScript code, just as you can in CSS:  /* Everything in between is a comment. */If your comment contains no line breaks, it's often easier to put it behind two slashes like this:  // This is a comment Comments www.iprismtech.com
  • 10.   An operator is a mathematical symbol which produces a result based on two values (or variables). In the following table you can see some of the simplest operators, along with some examples to try out in the JavaScript console. Operators Operator Explanation Symbol(s) Example add/concatenati on Used to add two numbers together, or glue two strings together. + 6 + 9; "Hello " + "world!"; subtract, multiply, divide These do what you'd expect them to do in basic math. -, *, / 9 - 3; 8 * 2; // multiply in JS is an asterisk 9 / 3; assignment operator You've seen this already: it assigns a value to a variable. = var myVariable = 'Bob'; www.iprismtech.com
  • 11.   Identity operator Does a test to see if two values are equal to one another, and returns a true/false (Boolean) result. === var myVariable = 3;  myVariable === 4;  Negation, not equal Returns the logically opposite value of what it precedes; it turns a true into a false, etc. When it is used alongside the Equality operator, the negation operator tests whether two values are not equal. !, !==  The basic expression is true, but the comparison returns false because we've negated it:  var myVariable = 3;  !(myVariable === 3);  Here we are testing "is myVariable NOT equal to 3". This returns false because myVariable IS equal to 3.  var myVariable = 3;  myVariable !== 3; www.iprismtech.com
  • 12.   Conditionals are code structures which allow you to test if an expression returns true or not, running alternative code revealed by its result. The most common form of conditional is called if ... else. So for example:  var iceCream = 'chocolate'; if (iceCream === 'chocolate') { alert('Yay, I love chocolate ice cream!'); } else { alert('Awwww, but chocolate is my favorite...'); }The expression inside the if ( ... ) is the test — this uses the identity operator (as described above) to compare the variable iceCream with the string chocolate to see if the two are equal. If this comparison returns true, the first block of code is run. If the comparison is not true, the first block is skipped and the second code block, after the elsestatement, is run instead. Conditionals www.iprismtech.com
  • 13.  Functions are a way of packaging functionality that you wish to reuse. When you need the procedure you can call a function, with the function name, instead of rewriting the entire code each time. You have already seen some uses of functions above, for example:  var myVariable = document.querySelector('h1');  alert('hello!');  These functions, document.querySelector and alert, are built into the browser for you to use whenever you desire.  If you see something which looks like a variable name, but has brackets — () — after it, it is likely a function. Functions often take arguments — bits of data they need to do their job. These go inside the brackets, separated by commas if there is more than one argument.  For example, the alert() function makes a pop-up box appear inside the browser window, but we need to give it a string as an argument to tell the function what to write in the pop-up box. Functions www.iprismtech.com
  • 14.   The good news is you can define your own functions — in this next example we write a simple function which takes two numbers as arguments and multiplies them:  function multiply(num1,num2) { var result = num1 * num2; return result; }Try running the above function in the console, then test with several arguments. For example:  multiply(4,7); multiply(20,20); multiply(0.5,3); www.iprismtech.com
  • 15.  Real interactivity on a website needs events. These are code structures which listen for things happening in browser, running code in response. The most obvious example is the click event, which is fired by the browser when you click on something with your mouse. To demonstrate this, enter the following into your console, then click on the current webpage:  document.querySelector('html').onclick = function() { alert('Ouch! Stop poking me!'); }There are many ways to attach an event to an element. Here we select the HTML element, setting its onclick handler property equal to an anonymous (i.e. nameless) function, which contains the code we want the click event to run.  Note that  document.querySelector('html').onclick = function() {};is equivalent to  var myHTML = document.querySelector('html'); myHTML.onclick = function() {};  It's just shorter. Events www.iprismtech.com
  • 16.   iPrism Technologies  Contact-+918885617929  Email-id: sales@iprismtech.com Thank you www.iprismtech.com