Skip to content

Instantly share code, notes, and snippets.

@luckyduck
Created January 25, 2015 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luckyduck/8022a1e802d7d46ff356 to your computer and use it in GitHub Desktop.
Save luckyduck/8022a1e802d7d46ff356 to your computer and use it in GitHub Desktop.
Variablenübung
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Grundlagen der Programmierung - Datentypen</title>
</head>
<body>
<script type="text/javascript">
// 1. Variablen deklarieren und initialisieren
var integerWert = 20;
var floatWert = 5.0;
var ergebnis = integerWert / floatWert;
// 2. Variablen in einem Array speichern
var berechnung = {a: integerWert, b: floatWert, c: ergebnis};
// 3. Ausgabe
document.write(berechnung['a'] + " / " + berechnung['b'] + " = " + berechnung['c']);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment