Theorie Javascript Flashcards
Javascript is a …
- weakly typed
- object-based
- dynamic
- mulit-paradigm
…scripting language
Every browser on every OS runs
… JS
Wikipedia lists 40 environments for “Uses outside Web pages”
And that is because…
…
- JS is small and lightweight
- JS runs inside hose environments
Wikipedia lists 40 environments for “Uses outside Web pages”.
Typical uses are:
- embedded Scripting Language (JS inside Applications)
- Scripting Engine (JS on OS level)
- Application platform (JS as the main programming language)
Client-side JS?
control of a browser and the DOM
eg. Webrosers
Server-side JS?
control of objects relevant for servers
eg. Node.js
Mobile Platforms
control of native APIs
eg. Apache Cordova/Phonegap
What is ECMAScript
is a Standard for scripting languages
Javascript is based..
on the ECMAScript standard
ECMA International
European association for standardizing information and communication systems
the ECMAScript spec is not for …
app developers, but for language implementors!
specification != Documentation
companies can use the open standard language to develop their…
own implementation
ECMAScript is also approved by…
the ISO
Assignment
=
e.g. a = 41
math
*
/
e.g.: a+1
compound Assignment
*=
/=
e.g.: a+=1
increment/decrement
e.g. a++
equality
==
!= unequal
!== unequal
e.g.: a==42
comparison
<
>
<=
>=
e.g.: a<=42
logical
&& and // or
primitive types of Javascript
- numbers
- strings
- booleans (true and false)
- null
- undefined
- symbol
All other values are objects.
Objects in Javascript are…
… mutable keyed collections
an object is a …
.. container of properties
a property has a …
name and a value
a property name can …
be any string, including the empty string
a property vlaue can be…
any Javascript value (except for undefined)
objects have no
constraint on the name of new properties or on the values of properties
objects can contain
other objects, to represent tree or graph structures
object literals
- provide a very convenient notation for creating new object values
- is a pair of curly braces surrounding zero or more name/value pairs
e.g.: var empty_object = {};
var stooge = {
“first-name”: “Jerome”,
“last-name”: “Howard”
};
in JavaScript commas are used to
seperate the pairs